Local-dates: dates show days in the future

AI-generated summary

The discussion is about an issue with Local-dates, where dates show days in the future. supermathie reported the issue and provided an example of the problem, where the timezones displayed are not the ones specified in the timezones attribute. zogstrip confirmed the issue and found the problem to be a mutation of the same dateTime object when generating previews, causing a discrepancy. This issue has been fixed in a commit to the Discourse repository (https://github.com/discourse/discourse/commit/c131903e56227ce76f649cc24d327f640ae843e7).

For example:

[date=2019-06-05 timezone="America/Toronto" timezones="Africa/Cairo|America/Toronto|UTC"]

2019-06-05T04:00:00Z

shows up in preview and baked for me as:

UTC is not 52h in the future for me :smiley: (it’s 4h ahead)

4 Likes

I know @zogstrip was hunting for a bug of this kind the other day, will assign him for now.

5 Likes

Ok, I’m not crazy :crazy_face:


Leaving a note for future me, here’s what I see now

The timezones are all wrong here… Paris, Paris, UTC :thinking:

5 Likes

4 Likes

Yeah, but it should show the ones in the timezones attribute… Not some apparently random ones :open_mouth:

5 Likes

you know me - love my images

Also, yes, Paris and Paris aren’t 24h apart… :smiley:

5 Likes

Pretty sure I fixed that in

https://github.com/discourse/discourse/commit/c131903e56227ce76f649cc24d327f640ae843e7

We were mutating the same dateTime object when generating the previews (ie. the date ranges in the tooltip), thus creating a discrepancy in the space time continuum :boom: .

7 Likes

This topic was automatically closed after 6 hours. New replies are no longer allowed.