Commit Graph

8 Commits

Author SHA1 Message Date
zachd
ef6a167431 Enhance calendar functionality with start date management and excluded month visibility. Added start date state and date picker for user-defined start dates. Updated holiday and PTO calculations to respect the start date. Improved UI to toggle excluded months and display active months based on the start date. Refactored related utility functions for better date handling. 2025-11-10 00:28:42 +01:00
Zachary
1c4aa803bd Improve consecutive group calculation to only exclude all weekend groups 2024-11-22 20:46:35 +01:00
Zachary
44762113e8 Add a nice cleanup of holidayUtils.js 2024-11-22 20:16:01 +01:00
Zachary
f9dc40a857 Allow customisable Weekend days 2024-11-22 19:39:56 +01:00
Zachary
50fb4f399f Add extra sort on holiday naming due to conflict 2024-11-22 19:07:48 +01:00
Christopher Orr
3d89eb8582 Handle multi-day holidays.
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.
2024-11-15 10:17:27 +01:00
Christopher Orr
7ac4e085eb Try to show holiday names using the browser's preferred language(s).
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.
2024-11-15 10:17:12 +01:00
Zachary
f22af52e9b Fix most errors and warnings with GPT, switch to .ts etc 2024-11-13 22:23:07 +01:00