Closed angrybrad closed 1 year ago
12/21/2023
sounds a lot to my European brain like the 12th day of the 21st month of the 2023rd year.
21 months gives you a remainder of 9 (21 % 12 = 9
) plus a carried year, resulting in the the 12th day of the 9th month of 2024th year, i.e. 12 / September / 2024
.
Do you see where I'm going with this @angrybrad, or should I continue spelling it out?
That explains the math of the results but not the underlying cause of the issue.
The underlying issue is that Campaign 1.x uses the old-school Live Preview request method that Categories use in Craft 3.x.
We were able to reproduce this on Craft 3.x Category Live Preview requests and pushed up a fix here: https://github.com/craftcms/cms/commit/c92d7114c27f77a194203b5925cdc585aadc67f1
And made a PR with the same fix for Campaign here: https://github.com/putyourlightson/craft-campaign/issues/360
You needed to be logged in with a user that had a number/date formatting locale that was different than what the front-end site language/formatting locale was set to to be able to reproduce.
I have yet to check Campaign 2.x, but Craft 4 moved Categories to the newer Live Preview logic, where it’s not an issue, so I’m guessing it’s not an issue in Campaign 2.x, too.
Aha, I missed the important detail that this was only an issue in Live Preview. Thanks for the PR, merged. This shouldn't be an issue in Campaign 2, as it uses the newer Preview logic.
Released in version 1.24.1, thanks for the bug report!
Using a fresh install of Craft Pro 3.7.63.1 and Campaign 1.24.0.
myDate
.myDate
to the field layout.templates/test.html
file with this in it:21 / December / 2023
is properly output as the date.12 / September / 2024
.This doesn’t happen with native Date fields outside the context of the Campaign plugin, like on entries.
Haven’t checked to see if this is an issue on Craft 4 / Campaign 2.