Timezone bug

AI-generated summary

A timezone bug has been identified in the calendar feature. RGJ encountered the issue when clicking on dates in the same paragraph, and provided a gif to illustrate the problem. twofoursixeight also experimented with the calendar feature and found related weird behavior on mobile. ted explained that the bug is due to a fallback mechanism for detecting date ranges, which relies on counting child elements in a paragraph and is disrupted by the modal element. A fix has been implemented in PR#19477, as confirmed by ted.

Just encountered this. Look at time in the the left popup when I click first-second-first.

For example 2022-12-13T14:00:00Z would be ideal, although I could also probably make 2022-12-13T13:30:00Z?

It only happens when the two dates are in the same paragraph, so pressing enter before “although” resolves the issue.

Gif

ShareX_P1flUbr0tX

7 Likes

I played around with the calendar feature and found some weird stuff, might relate to the bug.
I am on mobile(iPad) by the way




2 Likes

Great catch! :eye:

When we added dedicated support for date ranges we also added a fallback for the old, “automagic” way of detecting them (i.e. are there two dates in the paragraph, if so consider it a range.)

This fallback relies on checking the number of child elements in the paragraph. When expanding the modal, the modal element is added as a child element as well. This is why there are different results when clicking a date depending on whether a modal is already open or not.

Working on a fix.

4 Likes

This has been fixed in PR#19477. :bowing_man:

https://github.com/discourse/discourse/pull/19477

5 Likes