[
https://issues.apache.org/jira/browse/FREEMARKER-95?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
James Barnes updated FREEMARKER-95:
-----------------------------------
Comment: was deleted
(was: It refers to the Gregorian year 1475 due to the 543 year difference
between the two calendars. This has been confirmed because I have tested when
the leap years would line up, FreeMarker syncs up with the correct output on
March 1 2019 Gregorian and goes out of sync on March 2020. This a result of 543
mod 4 = 3, implying the output would be sync for a year and out of sync for 3
years. It is not a timezone issue because I should have specified earlier but
we are using Date (which does not have a timezone attached to it) not Datetime.
Additionally, our application handles ~20 different languages and Thai is the
only language that gives us issues. So our {{payload.bookingDate}} would be a
date with an example value of "04-26-2018".
So let me try and clarify my description of the bug. The issue occurs when
FreeMarker is given a Gregorian calendar date(such as "04-26-2018") and a
Locale of "th_TH", it interprets the date as a Buddhist calendar date and
returns the BuddhistCalendar results for 04-26-2018 (or 04-26-1475 Gregorian).
This is not a Java issue because if you run the code provided above Gregorian
dates do not need to be explicitly defined and the correct results are returned
with the Thai Locale. We are using Java Dates so timezone cannot be the issue.
Maybe you are not reproducing the issue with Datetimes is because with an
attached timezone, FreeMarker is properly recognizing it as a Gregorian
datetime, but this would just be a guess.
)
> Wrong day of the week shown for the Thai locale
> -----------------------------------------------
>
> Key: FREEMARKER-95
> URL: https://issues.apache.org/jira/browse/FREEMARKER-95
> Project: Apache Freemarker
> Issue Type: Bug
> Reporter: James Barnes
> Priority: Major
>
> Freemarker returns the wrong day of the week when the user sets the the
> locale to Thai. It would seem that this is a result of Freemarker not
> correcting for the Buddhist calendar. The day of the week is currently out of
> sync but will be back in sync on Feb 28 2019 and then will be out of sync
> again on Feb 29 2020. So currently when the user sets the locale to Thai,
> FreeMarker uses the days of the week from 1475 on the Gregorian calendar.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)