feat: add company holiday preference feature with UI and logic for holiday selection
All checks were successful
Build and Push Docker Image / build (push) Successful in 29s
All checks were successful
Build and Push Docker Image / build (push) Successful in 29s
This commit is contained in:
@@ -45,6 +45,15 @@ function getPublicHolidays(year, bundesland) {
|
||||
holidays.push({ date: new Date(year, 11, 25), name: '1. Weihnachtstag' });
|
||||
holidays.push({ date: new Date(year, 11, 26), name: '2. Weihnachtstag' });
|
||||
|
||||
// Company-provided holiday: Christmas Eve (24.12) or New Year's Eve (31.12)
|
||||
// Default to Christmas if companyHolidayPreference is not defined
|
||||
const companyHolidayPref = typeof companyHolidayPreference !== 'undefined' ? companyHolidayPreference : 'christmas';
|
||||
if (companyHolidayPref === 'christmas') {
|
||||
holidays.push({ date: new Date(year, 11, 24), name: 'Heiligabend (Betriebsfrei)' });
|
||||
} else if (companyHolidayPref === 'newyearseve') {
|
||||
holidays.push({ date: new Date(year, 11, 31), name: 'Silvester (Betriebsfrei)' });
|
||||
}
|
||||
|
||||
// Heilige Drei Könige (BW, BY, ST)
|
||||
if (['BW', 'BY', 'ST'].includes(bundesland)) {
|
||||
holidays.push({ date: new Date(year, 0, 6), name: 'Heilige Drei Könige' });
|
||||
|
||||
Reference in New Issue
Block a user