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 =
let offset = 1 - int_of_day day in
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 line = { headers : string cell list; cells : 'a cell list }
......@@ -130,8 +131,8 @@ module Make (R : ResourcesT) = struct
[
("id", `String ("evt" ^ string_of_int id));
("title", `String (R.title c.resources));
("start", `String (Pr.sprint "%FT%T" c.start));
("end", `String (Pr.sprint "%FT%T" (ends c)));
("start", `String (to_isostring c.start));
("end", `String (to_isostring (ends c)));
]
in
`List
......@@ -150,7 +151,7 @@ module Make (R : ResourcesT) = struct
let tpl =
{|
<!DOCTYPE html>
<html lang='en'>
<html lang='fr-FR'>
<head>
<meta charset='utf-8' />
<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
var calendarEl = document.getElementById('calendar');
var calendar = new FullCalendar.Calendar(calendarEl, {
initialView: 'timeGridWeek',
events: data
events: data,
locale: 'fr',
aspectRatio: 2
});
calendar.render();
});
......@@ -169,7 +172,7 @@ module Make (R : ResourcesT) = struct
</script>
</head>
<body>
<div id='calendar'></div>
<div id='calendar' style='width: 80%; padding: 20px;'></div>
</body>
</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