Skip to content
Snippets Groups Projects
Commit 0a9b3dd7 authored by Emmanuel Coquery's avatar Emmanuel Coquery
Browse files

HTML simple page fix

parent 17cd634d
No related branches found
No related tags found
No related merge requests found
...@@ -24,7 +24,8 @@ let week_start_of_date d : date = ...@@ -24,7 +24,8 @@ let week_start_of_date d : date =
let offset = 1 - int_of_day day in let offset = 1 - int_of_day day in
add d (Period.day offset) add d (Period.day offset)
(* let as_iso (d : date) : string = CalendarLib.Printer.Date.sprint "%F" d *) let to_isostring (dt: CalendarLib.Calendar.t): string =
CalendarLib.Printer.Calendar.sprint "%FT%T" dt
(* type 'a cell = { rowspan : int; colspan : int; content : 'a } (* type 'a cell = { rowspan : int; colspan : int; content : 'a }
type 'a line = { headers : string cell list; cells : 'a cell list } type 'a line = { headers : string cell list; cells : 'a cell list }
...@@ -130,8 +131,8 @@ module Make (R : ResourcesT) = struct ...@@ -130,8 +131,8 @@ module Make (R : ResourcesT) = struct
[ [
("id", `String ("evt" ^ string_of_int id)); ("id", `String ("evt" ^ string_of_int id));
("title", `String (R.title c.resources)); ("title", `String (R.title c.resources));
("start", `String (Pr.sprint "%FT%T" c.start)); ("start", `String (to_isostring c.start));
("end", `String (Pr.sprint "%FT%T" (ends c))); ("end", `String (to_isostring (ends c)));
] ]
in in
`List `List
...@@ -150,7 +151,7 @@ module Make (R : ResourcesT) = struct ...@@ -150,7 +151,7 @@ module Make (R : ResourcesT) = struct
let tpl = let tpl =
{| {|
<!DOCTYPE html> <!DOCTYPE html>
<html lang='en'> <html lang='fr-FR'>
<head> <head>
<meta charset='utf-8' /> <meta charset='utf-8' />
<script src='https://cdn.jsdelivr.net/npm/fullcalendar@6.1.15/index.global.min.js'></script> <script src='https://cdn.jsdelivr.net/npm/fullcalendar@6.1.15/index.global.min.js'></script>
...@@ -161,7 +162,9 @@ module Make (R : ResourcesT) = struct ...@@ -161,7 +162,9 @@ module Make (R : ResourcesT) = struct
var calendarEl = document.getElementById('calendar'); var calendarEl = document.getElementById('calendar');
var calendar = new FullCalendar.Calendar(calendarEl, { var calendar = new FullCalendar.Calendar(calendarEl, {
initialView: 'timeGridWeek', initialView: 'timeGridWeek',
events: data events: data,
locale: 'fr',
aspectRatio: 2
}); });
calendar.render(); calendar.render();
}); });
...@@ -169,7 +172,7 @@ module Make (R : ResourcesT) = struct ...@@ -169,7 +172,7 @@ module Make (R : ResourcesT) = struct
</script> </script>
</head> </head>
<body> <body>
<div id='calendar'></div> <div id='calendar' style='width: 80%; padding: 20px;'></div>
</body> </body>
</html> </html>
|} |}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment