-
Bug
-
Resolution: Fixed
-
Normal
-
6.5.8.1
Steps to Reproduce
open in zkfiddle
<zk> <datebox format="dd/MM/yyyy"/> <datebox format="dd/MM/yy"/> </zk>
- Open datebox to choose Jan 1st, 1900
- Open datebox again
Current Result
dd/MM/yyyy => 1st Jan, 1900
dd/MM/yy => 1st Jan, 2000
Expected Result
dd/MM/yyyy => 1st Jan, 1900
dd/MM/yy => 1st Jan, 1900
Since the date is by choice, not by inputting. Should have confidence about the year.
Debug Information
https://github.com/zkoss/zk/blob/v8.6.1/zul/src/archive/web/js/zul/db/Datebox.js#L766
https://github.com/zkoss/zk/blob/v8.6.1/zul/src/archive/web/js/zul/inp/InputWidget.js#L806
When a date is chosen, it will call updateChange_ which is called _validate to coerce from text
Workaround
Avoid using yy only in format.