-
Bug
-
Resolution: Fixed
-
Normal
-
6.0.0
-
ZK 8.6.2 S2
Steps to Reproduce
<zk> <zscript><![CDATA[ Sessions.getCurrent().setAttribute("px_preferred_locale", new Locale("th","TH")); ]]></zscript> <datebox onCreate="self.value = new Date();" format="short"/> <button label="Click me after you test done" onClick='Sessions.getCurrent().removeAttribute("px_preferred_locale")' /> </zk>
- Fiddle: http://zkfiddle.org/sample/3eq32v6/1-ZK-4242
- Open the datebox
- Check the calendar date
Current Result
In 2019/03/15 (15 มี.ค. 2562) It shows "15 มี.ค. 1962"
Expected Result
In 2019/03/15 (15 มี.ค. 2562) It shows "15 มี.ค. 2562"
Debug Information
https://github.com/zkoss/zk/blob/v8.6.1/zul/src/archive/web/js/zul/db/Datebox.js#L700
It uses the text of textbox to parse the Date, which only has 2 digits in years.
Workaround
Use full year format instead (like dd MMM yyyy)