#64 Show locale-aware date strings
Merged by a2batic. Opened by amitosh.
amitosh/Fedora-app locale-aware-date  into  master

Download 64.patch

Closes #58

Known Issues:

  • This utilizes JS Intl API. This is horribly broken on Firefox from the repos, which completely disregards the system locale.
  • ~~There is a disparity in the fedocal APIs. The meeting reminders that are sent in emails, the fedocal documentation and the events that are entered are completely out-of-sync! This leads to confusion in timezones~~ Confirmed that FedoCal API gives out date and time in UTC (See below).

rebased onto a67b985d7408c12edabcb5bf3b698088fa9909e7

rebased onto 103b5228968311166c6c172b85890f7f3a9798e3

Confirmed API returns time in UTC

Here's the discussion @ #fedora-apps

[15:27] <amitosh> hi all! We are building the android app which interacts with fedocal API
[15:28] <amitosh> Can someone clarify about whether the time returned by /meeting endpoint is in UTC?
[15:29] <cverna> pingou: ^^
[15:30] <pingou> I believe it is
[15:30] <cverna> amitosh: I would say yes
[15:30] <pingou> but it should say so
[15:30] <pingou> amitosh: there is a meeting_timezone
[15:31] <pingou> that explicits the timezone
[15:37] <amitosh> pingou, cverna thanks for the response
[15:37] <amitosh> pingou: so meeting_timezone says the time zone for the meeting_time_start and meeting_time_stop?
[15:38] <pingou> yup
[15:38] <amitosh> We tried that, but we are getting incorrect results
[15:39] <amitosh> In case of fedora join sig (https://fedoraproject.org/wiki/SIGs/Join/Next_Meeting?rd=Fedora_Join_SIG/Next_Meeting)
[15:40] <amitosh> meeting_time_start: "17:00:00"
[15:40] <amitosh> meeting_time_stop: "18:00:00"
[15:40] <amitosh> meeting_timezone: "Europe/London"
[15:40] <amitosh> "Europe/London" !== "UTC", they have dst and other stuff :/
[15:40] <pingou> it could be that the wiki is outdated or that the person entering the entry in fedocal didn't set the right timezone
[15:41] <pingou> the usual error in, error out :)
[15:42] <amitosh> not just that, the same error is for all the meetings in QA!
[15:43] <pingou> https://apps.fedoraproject.org/calendar/meeting/9231/?from_date=2018-06-12
[15:43] <pingou>     Start: Tue, June 12, 2018 - 16:00 UTC
[15:44] <pingou>     End: Tue, June 12, 2018 - 17:00:00 UTC
[15:45] <pingou> this is odd indeed
[15:46] <pingou> Stored as:
[15:46] <pingou>     Start: 2018-05-15 - 18:00:00 Europe/London
[15:46] <pingou>     End: 2018-05-15 - 19:00:00 Europe/London
[15:46] <pingou> so it's consistent
[16:59] <amitosh> pingou: Yes
[16:59] <amitosh> But this one here: https://apps.fedoraproject.org/calendar/api/meetings?calendar=QA
[16:59] <amitosh> meeting time is 15:00:00, and the meeting actually happens in 15:00 UTC
[17:27] <pingou> amitosh: Stored as:
[17:27] <pingou>     Start: 2018-06-04 - 11:00:00 America/New_York
[17:27] <pingou>     End: 2018-06-04 - 12:00:00 America/New_York
[17:28] <pingou> seeing this, I think you're right the start/stop times are given in UTC in the API
[17:28] <pingou> I'd have to double-check the code though, this surprises me a bit
[17:52] <amitosh> https://github.com/fedora-infra/fedocal/blob/master/fedocal/api.py#L393
[17:54] <amitosh> pingou: https://github.com/fedora-infra/fedocal/blob/master/fedocal/fedocallib/__init__.py#L800
[17:55] <amitosh> Indeed it is converted into UTC
[17:55] <amitosh> It makes sense to document this
[17:55] <pingou> +1
[17:55] <amitosh> I'll probably make a PR for this soon
[17:56] <pingou> thank you for that
[17:56] <pingou> I've on my todo to cut a new release one of these days
[17:56] <pingou> so I may wait for your PR so it's included

rebased onto cdc091c0e771fd15d6e08d4f96e16d6a30201558

Remove console statement if not required

Just curious, why so many downgrades ?

2 new commits added

  • Parse date & time from FedoCal correctly
  • Locale aware date-time display

rebased onto 44d881b2eb6acd70622d8017652f561749e3f013

Lgtm :).

Pull-Request has been merged by a2batic

Metadata