- Introduced `fixedDaysOff` prop to `CalendarMonth.svelte` for specifying non-working days.
- Enhanced tooltip functionality to indicate fixed days off.
- Updated day click handling to respect fixed days off.
- Modified styles to visually distinguish fixed days off in the calendar.
- Adjusted `optimizeDaysOff` and `calculateConsecutiveDaysOff` functions to account for fixed days off.
- Added tests to ensure fixed days off are excluded from optimization but included in consecutive periods.
- Implemented UI elements for managing fixed days off in the settings panel.
Some countries (e.g. Russia, or Vietnam) have holidays which span several
days. Rather than using `holiday.date` from the date-holidays library, we
can check the `.start` (inclusive) and `.end` (exclusive) dates, and use
these to show multiple holiday days on the calendar.
However since these properties return a `Date` representing the start of
the day in that country, rather than an ISO string like `.date` does, we
also need to pass in the current browser `timezone` to the library, so
that we show the correct dates to the user.
The date-holidays library has translations for many holidays, so we can
usually show a useful translation to the user, rather than all holidays
appearing in the language of the selected country.
However, they only support two-character language codes, and don't have
any sort of fallback, e.g. using an available `en` translation if we
pass in `en-GB`. So we just truncate all languages to two characters.