feat: configurable weekend days in Vacay — closes #97

Users can now select which days are weekends (default: Sat+Sun).
Useful for countries like Bangladesh (Fri+Sat) or others with
different work weeks. Settings appear under "Block weekends" toggle.
This commit is contained in:
Maurice
2026-03-29 19:45:30 +02:00
parent b28b483b90
commit 2171203a4c
5 changed files with 47 additions and 7 deletions
+2 -3
View File
@@ -103,10 +103,9 @@ export function getHolidays(year: number, bundesland: string = 'NW'): Record<str
return holidays
}
export function isWeekend(dateStr: string): boolean {
export function isWeekend(dateStr: string, weekendDays: number[] = [0, 6]): boolean {
const d = new Date(dateStr + 'T00:00:00')
const day = d.getDay()
return day === 0 || day === 6
return weekendDays.includes(d.getDay())
}
export function getWeekday(dateStr: string): string {