-
-
Notifications
You must be signed in to change notification settings - Fork 211
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
fix: Incorrect Times/Timezones when fetching events #1060
Conversation
@DhairyaMajmudar @benjagm please review |
@techmannih the build and lint workflows are failing, pls. fix them |
built with Refined Cloudflare Pages Action⚡ Cloudflare Pages Deployment
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1060 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 10 10
Lines 373 373
Branches 94 94
=========================================
Hits 373 373 ☔ View full report in Codecov by Sentry. |
sure, please check now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @techmannih.
The times are not correct. They should be:
- JSON Schema Open Community Working Meetings should be at 19:00 UTC
- JSON Schema Office Hours (APAC/Americas) should be at 10:00 UTC
- JSON Schema Office Hours (Europe/Americas) should be at 14:00 UTC
You need to check what is the timezone of the meeting in the calendar and later convert to UTC:
- JSON Schema Open Community Working Meetings is stored in Europe/London timezone
- JSON Schema Office Hours (APAC/Americas) should be at 10:00 UTC is stored in America/Los_Angeles timezone.
- JSON Schema Office Hours (Europe/Americas) should be at 14:00 UTC is stored in Europe/London timezone.
@benjagm but in the calender these are different, Please clarify whether the time on the calendar is in the local time zone or in UTC |
We have 2 alternatives:
Whatever we decide we need the times the be consistent. |
IMO, the schedule would be better displayed in 24-hour UTC, its easier and clearer to understand for most. |
Just display both user-local and UTC. |
@techmannih, any update on this one? We'd love to fix this asap. |
Hey @benjagm, on fetching the data it's show on local time zone and for America/los_angles timezone makes difficulties to converting in utc |
Forget about local timezones. The calendar data has the original timezones associated to the events. You need to find that original timezones (I shared the details in previous comments) and then just convert to UTC accordingly. Again, forget about local timezones. |
Hey @benjagm 1. JSON Schema Open Community Working Meetings is stored int the calendar in Europe/London timezone which is also in UTC
(London is in UTC during the winter months (October to March), and during the summer months (April to September), London is in UTC+1 (British Summer Time), so the time difference is 1 hour.) 2. JSON Schema Office Hours (Europe/Americas) is stored in Europe/London timezone which is also in UTC
(London is in UTC during the winter months (October to March), and during the summer months (April to September), London is in UTC+1 (British Summer Time), so the time difference is 1 hour.) 3. JSON Schema Office Hours (APAC/Americas) (America/Los_Angeles Time Zone)
(Los Angeles follows Pacific Standard Time (PST) during the winter months (typically November to March), which is UTC -8:00. During the summer months (April to October), Los Angeles follows Pacific Daylight Time (PDT), which is UTC -7:00.) We can fix the time for Europe/London timezone in UTC, but for the America/Los_Angeles timezone, we need to determine the correct local time based on your needs, as the time difference will vary depending on the season (whether it's Standard Time or Daylight Saving Time). |
Great progress!!! Congrats. We'll use Daylight Saving Time. |
11:00 PM PDT in Los Angeles would be 6:00 AM UTC (the next day), is it correct ? |
Please note that Pacific Daylight Time (PDT) is a North American time zone in use only between the second Sunday in March to the first Sunday in November during Daylight Saving Time (DST). The rest of the year the timezone is PST Pacific Standard Timezone (PC), therefore now they are in PST.
|
Thanks @benjagm for confirming, But I am getting these times in the calendar for the events. If these are incorrect, please give me actual and correct time for all event and UTC time also |
Not sure about your data and how it appears in your browser/calendar. This is what I see (My timezone is CET) Remember that we are reading the ical file that is a text file from here https://calendar.google.com/calendar/ical/json.schema.community%40gmail.com/public/basic.ics. In this case this is the data available there: JSON Schema Open Community Working Meeting
JSON Schema Office Hours (Europe/Americas)
JSON Schema Office Hours (APAC/Americas)
Don't get confuse about how the data appears in your google calendar. Focus on the ical file, how this is converted to JSON and what JSON you have to work with. |
@benjagm Thanks for sharing this data; it's very helpful for understanding. The difference between CET and UTC is 1 hour, so according to UTC timings:
Please confirm if these are correct. If not, kindly provide the correct UTC timings. |
Looks good to me! |
Thank you, @benjagm, for confirming! I’ve made the updates, and it looks much better now. |
Yes!! Can you please add the changes to the logic in the community page? We have some duplicity of code and this will be a great opportunity to do some refactoring to avoid duplicate code, if that is possible. |
…ime display (24-hour format)
Sure @benjagm How's look? I’ve made the updates, and it looks much better now. |
Looking good. Are you going to do some code reformatting to avoid duplicity in the calendar parsing logic? |
@benjagm please check now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @techmannih, what benjagm was trying to convey is that the two files share the same code or function, which leads to redundancy and duplication. To address this issue, we should refactor the code to eliminate duplicate code.
@benjagm @DarhkVoyd please check now |
@benjagm Please review this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work with this @techmannih Sorry for the delay with the review!! Let's merge it.
What kind of change does this PR introduce?
Fixing a Bug, Incorrect Times/Timezones when fetching events from the Community calendar #1036
Issue Number:
Issue #1036
Screenshots/videos: