diff --git a/packages/web/src/components/Calendar.astro b/packages/web/src/components/Calendar.astro
index 34e7d07..aa13f85 100644
--- a/packages/web/src/components/Calendar.astro
+++ b/packages/web/src/components/Calendar.astro
@@ -88,6 +88,13 @@ function formatTime(time: number | Time): string {
typeof time === "number" ? Math.round((time - hour) * 60) : time.minute;
return `${hour.toString().padStart(2, "0")}:${minutes.toString().padStart(2, "0")}`;
}
+
+/***
+ * Changes from a 'sunday to saturday' week index to a 'monday to sunday' week index.
+ */
+function shiftWeekday(weekday: number) {
+ return (weekday + 6) % 7;
+}
---
@@ -100,12 +107,12 @@ function formatTime(time: number | Time): string {
>
{
// --- Weekday column headers ---
- ["L", "M", "M", "J", "V", "S", "D"].map((weekday, i) => (
+ weekdays.map((weekday, i) => (
- {weekday}
+ {weekday[0]}
))
}
@@ -162,13 +169,13 @@ function formatTime(time: number | Time): string {
marginLeft,
background: activity.color,
"grid-row": `${(activity.time.start.hour - timeMin) * cellScale + activity.time.start.minute / minuteScale + 2} / span ${(activity.time.end.hour - activity.time.start.hour) * cellScale + (activity.time.end.minute - activity.time.start.minute) / minuteScale}`,
- "grid-column": ((weekday + 6) % 7) + 2,
+ "grid-column": shiftWeekday(weekday) + 2,
"outline-style": "solid",
"outline-color": contrast(activity.color),
}}
class={cn([
"activity",
- "min-w-0 min-h-0 rounded p-1 ml-auto bg-primary relative",
+ "min-w-0 min-h-0 rounded p-1 ml-auto bg-primary relative overflow-hidden",
"outline-0 hocus:outline-2 hocus:border-none",
"data-[showcased=true]:outline-2 data-[showcased=true]:border-none data-[showcased=true]:z-20 ",
dark(activity.color) && "text-white",
@@ -190,11 +197,13 @@ function formatTime(time: number | Time): string {
{formatTime(activity.time.end)}
-
+
{activity.title}
{activity.subtitle?.length && (
- {activity.subtitle}
+
+ {activity.subtitle}
+
)}
diff --git a/packages/web/src/pages/horaire.astro b/packages/web/src/pages/horaire.astro
index bdb8962..8a07767 100644
--- a/packages/web/src/pages/horaire.astro
+++ b/packages/web/src/pages/horaire.astro
@@ -44,7 +44,34 @@ const activities: Activity[][] = [
color: "#f0f0ff",
},
],
- [],
+ [
+ {
+ type: 2,
+ title: "Initiation",
+ subtitle: "3 à 5 ans",
+ time: { start: { hour: 16, minute: 30 }, end: { hour: 17, minute: 30 } },
+ lessons: {
+ count: 2,
+ first: new Date(2025, 2, 2),
+ last: new Date(2025, 3, 4),
+ },
+ price: 28,
+ color: "#12fa83",
+ },
+ {
+ type: 2,
+ title: "Récréatif",
+ subtitle: "6 ans et plus",
+ time: { start: { hour: 17, minute: 45 }, end: { hour: 19, minute: 15 } },
+ lessons: {
+ count: 2,
+ first: new Date(2025, 2, 2),
+ last: new Date(2025, 3, 4),
+ },
+ price: 28,
+ color: "#fa1283",
+ },
+ ],
[
{
type: 0,