0

ZK Date for en_GB is broken

asked 2022-02-11 22:38:31 +0800

AndreiArdei gravatar image AndreiArdei
111 3

Good afternoon,

I am using ZK version 9.5.0.3 with JAVA 11. Using the DateBox with the locale of en_GB and a format of DateFormat.SHORT or the official dd/MM/y. According to this website, the date should be displayed as 12/01/2022, however the generated date is 12/01/22.

I created a ZK Fiddle https://zkfiddle.org/sample/oirisd/1-Datebox-en-GB-issue. While testing I also checked and on version 9.6.1 the official format works. Considering that I cannot easily update to zk 9.6.1, what could I do to fix this issue?

delete flag offensive retag edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2022-02-14 15:30:34 +0800

hawk gravatar image hawk
3250 1 5
http://hawkphoenix.blogsp... ZK Team

Because DateFormat.SHORT change between java 8 and 9, it's better to specify an explicit format : format="dd/MM/yyyy

This format both shows 4 digits of the year in 9.5.0.3 and 9.6.1.

link publish delete flag offensive edit
0

answered 2022-02-21 14:25:38 +0800

hawk gravatar image hawk
3250 1 5
http://hawkphoenix.blogsp... ZK Team

updated 2022-02-21 14:25:51 +0800

JDK 8 uses JRE as the default locale provider, whereas in JDK 9 onwards CLDR is the default locale provider. (see JEP 252: Use CLDR Locale Data by Default) Because of the change of the default locale provider, the built-in date formats (e.g. DateFormat.SHORT) stand for different formats after JDK 9.

You can use old data format by running JVM with the option:

-Djava.locale.providers=JRE,CLDR

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2022-02-11 22:38:31 +0800

Seen: 11 times

Last updated: Feb 21 '22

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More