mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-07-09 15:05:59 +00:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user