Commit Graph

15 Commits

Author SHA1 Message Date
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
Zachary
1b862710d7 Fix M, T, W... days 2024-11-13 17:15:59 +01:00
Zachary
99f76a9a99 Support Monday/Sunday day of week 2024-11-13 14:38:22 +01:00
Zachary
98bb16730e Add state selection 2024-11-13 00:52:28 +01:00
Zachary
b15cd053b3 Add icons around days off 2024-11-11 19:50:28 +01:00
Zachary
0b1ecdaa93 Smaller screens 2024-11-11 18:45:32 +01:00
Zachary
1c52afa674 Cleanup 2024-11-11 18:19:45 +01:00
Zachary
4216b83837 Improve algorithms 2024-11-11 16:47:35 +01:00
Zachary
b3fb346509 Add fixed data for every country from wikipedia 2024-11-10 21:34:28 +01:00
Zachary
09c38c8b1f Add new utils file, deploy 2024-11-10 21:27:02 +01:00
Zachary
eb7ec1f8bd Updates 2024-11-10 19:53:59 +01:00
Zachary
a5d4a66078 Add missing 2024-11-10 17:37:44 +01:00
Zachary
1ba361be74 Initial commit 2024-11-10 15:58:42 +01:00