-
-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Holidays update #173
Holidays update #173
Conversation
@Aga-C if you can, please check the holidays for your country: https://github.com/FossifyOrg/Calendar/pull/173/files#diff-4611a3af6b8d110909a5949c975ad17778111b697d7098ba0186733df06aa6de |
|
The data from the library looks correct, this is probably related to how the DST is handled as in #165 and #166.
It's done on purpose. The more holidays we add, the larger the app size. As of now, the ICS asset files added about 70KB when a release APK is created on I'll check these issues after I'm done with some other apps, thanks! |
ICS file has incorrect data. Maybe it's timezone issue, but in the generator itself:
|
Oops, I forgot that timezone info should be preserved when generating ICS from the date-holidays data. Currently, the 'time' part of the DateTime is ignored completely: Calendar/.github/workflows/holiday-generator/main.js Lines 56 to 58 in 1a0ca55
I'll address this later as well (adding to my TODO list). |
@Aga-C Thanks :) |
I think it's not necessarily needed to keep timezone info in ICS, rather it should be considered in this code. As I see, the Date object returns date information based on the timezone you're currently in, that's why there are wrong dates. I can take a look into it today, to get a date in a given country's timezone. |
I meant we should save the timestamps in UTC directly like |
Will the app still consider that properly as the all-day events? Wouldn't it lead to issues with adding events from other countries? E.g. if I add USA holidays while living in Europe, I'd like to see that e.g. M.L.K Day is on 20th February (all-day), not 20th February 5:00 till 21st February 4:59. |
Actually no, the importer would fail to detect it as an all-day event. All holidays should be treated as all-day events (even if the data says otherwise because we can not handle every case). Let's proceed with your proposed solution. Just adding the country's timzone offset to the start and end datetime should fix this issue.
It's been a while since I worked with this but IIRC all-day events will show up on the same date in any timezone (the date-time event fields are shifted such that an all-day event on 4th July shows up on 4th July regardless of the user's timezone). |
@naveensingh I've just found a quick solution in date provider. I can set it to return dates in UTC with this function: https://github.com/commenthol/date-holidays-parser/blob/master/docs/Holidays.md#holidayssettimezonetimezone. I'll test it out and if it works correctly, I'll send a PR with a fix. |
9dca57b
to
3dc162a
Compare
australia.ics of this PR only includes country-wide public holidays and missing state-specific holidays (e.g. labour day, king's birthday, easter tuesday). |
Holidays generator author here. I did it this way because I didn't know how we should treat regional/state holidays. The same goes for many other countries, e.g. the USA - each state has their own holidays and there are countrywide ones. When we have just the USA or Australia in the app, not particular states, I thought it's better to add only countrywide holidays. It can be always changed, though. Generally, there are three options how we can approach holiday generation in this case:
In my opinion, the current solution (first option above) is the most universal, but I'm open to modifying the current solution into the third option. |
apple/google/microsoft show regional holidays when importing australia holidays, so australian users are accustomed to it or even expecting it. |
I can modify it, but I need to know if it should be done only for Australia or for all countries. @naveensingh what do you think? |
Let's wait for some user feedback before making any further changes. Later we'll consider adding a custom field like |
No description provided.