thomersch / openstreetmap-calendar

osmcal, a Collaborative Calendar for OpenStreetMap-related Events
https://osmcal.org
Apache License 2.0
33 stars 9 forks source link

Investigate Date Formatting Issues #42

Open thomersch opened 3 years ago

thomersch commented 3 years ago

The whole date range formatting is kind of a faff: The templates are difficult to read and the i10n situation is a little bit complex. But besides the conventions, there are some proper bugs:

At least those two need to be investigated and fixed. I assume the Django API is being misused in OSMCAL code or Django itself has some issues.

thomersch commented 3 years ago

Apparently, the french capitalization issue is fixed by using "E" instead of "F" in the date template (fixed in https://github.com/thomersch/openstreetmap-calendar/commit/e9359f92635f43116ef003bbcc47c460e9bfa6f5).

thomersch commented 3 years ago

We should consider using Babel for formatting dates, since it seems to have the functionality to format date/time ranges.

assanges commented 3 years ago

We should consider using Babel for formatting dates, since it seems to have the functionality to format date/time ranges.

Agreed. YMD format is being used instead in some Languages (e.g. dz, en-CA/fr-CA, hu, lt, ja, ko, mn, zh, etc), so they are incompatible with current syntax.

thomersch commented 3 years ago

I have done a little bit in that direction (e.g. "2021年4月22日 12:00 德国(柏林)时间"), but Babel still needs some glue code if we want to use it. A particular problem are multi-day events with times, e.g. "20 Aug 2029, 17:00:00 – 22 Aug 2029, 19:00:00 UTC", where neither month formatting nor time formatting are well-controllable. For detail pages I would want to show full-width months (e.g. "August"), but skip the seconds altogether. This will require some more hacking around, but I haven't given up yet!