Skip to content

Commit f226729

Browse files
committed
Demo: étendre le hint vacances scolaires au samedi
Le hint « Vacances scolaires » de la démo ne retenait que les jours du lundi au vendredi, alors que la grille du calendrier souligne déjà tous les jours de vacances hors dimanche. Les samedis de vacances sont désormais inclus (ils forment leur propre groupe avec la policy per-day-of-week) et le hint est renommé « Vacances scolaires (lun-sam) ». Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YKAhghsLQ1yKQSP5TwvYWb
1 parent 05183b6 commit f226729

3 files changed

Lines changed: 11 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
## Upcoming release
44

5+
- Demo: the built-in school-vacation hint now covers Monday to Saturday
6+
instead of Monday to Friday, and is renamed « Vacances scolaires
7+
(lun-sam) ». Saturdays inside a vacation period therefore get their own
8+
per-day-of-week group, matching what the calendar grid already
9+
highlighted (every vacation day except Sundays).
10+
511
- Demo: the calendar grid now underlines school-vacation days (Sundays
612
excluded) and marks public holidays with an asterisk next to the day
713
number; both are also spelled out in each day's tooltip.

website/src/components/HintsView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default function HintsView({ generated }: { generated: GeneratedHints })
1717
<li key={h.date}><code>{h.date}</code>{h.name}</li>
1818
))}
1919
</ul>
20-
<h3>Vacances scolaires (jours lundi-vendredi retenus)</h3>
20+
<h3>Vacances scolaires (jours lundi-samedi retenus)</h3>
2121
<ul>
2222
{generated.vacationRanges.map(v => (
2323
<li key={v.label + v.first}>{v.label} : <code>{v.first}</code><code>{v.last}</code></li>

website/src/hints.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,10 @@ export function schoolVacationRanges(
122122
.sort((a, b) => a.first.localeCompare(b.first))
123123
}
124124

125-
/** Jours de vacances scolaires, du lundi au vendredi uniquement. */
125+
/** Jours de vacances scolaires, du lundi au samedi (dimanches exclus). */
126126
export function vacationDaysOf(ranges: VacationRange[]): string[] {
127-
const isMonToFri = (d: string) => weekdayOf(d) >= 1 && weekdayOf(d) <= 5
128-
return [...new Set(ranges.flatMap(v => eachDay(v.first, v.last)))].filter(isMonToFri).sort()
127+
const isMonToSat = (d: string) => weekdayOf(d) >= 1 && weekdayOf(d) <= 6
128+
return [...new Set(ranges.flatMap(v => eachDay(v.first, v.last)))].filter(isMonToSat).sort()
129129
}
130130

131131
// ---------------------------------------------------------------------------
@@ -148,7 +148,7 @@ export interface HintConfig {
148148

149149
export const DEFAULT_HINT_CONFIGS: HintConfig[] = [
150150
{ id: 'holidays', source: 'holidays', name: 'Jours fériés', policy: 'match-all', enabled: true, daysText: '' },
151-
{ id: 'school-vacations', source: 'school-vacations', name: 'Vacances scolaires (lun-ven)', policy: 'per-day-of-week', enabled: true, daysText: '' },
151+
{ id: 'school-vacations', source: 'school-vacations', name: 'Vacances scolaires (lun-sam)', policy: 'per-day-of-week', enabled: true, daysText: '' },
152152
]
153153

154154
const DATE_RE = /^\d{4}-\d{2}-\d{2}$/

0 commit comments

Comments
 (0)