-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi,
I have a databox defined as:
<datebox id="dob" visible="true" format="${labels.ui.locale.dateformat}" lenient="false"/>
where the label is set to MM/dd/yyyy.
When a user enters a two-digit year instead, the datebox converts it to a 4-digit year adding 1900 to the year. However, when I get the value of the database, i.e. dob.getValue(); It returns a date object with only the two digit year, like so:
DOB: Sat Aug 08 00:00:00 UTC 89
How do I keep from user's entering a 2-digit year? Or, how do I get the value displayed in the datebox, a converted 4-digit year? Is there a better way to handle dob.getValue() returning a date?
Hello michaelh,
Probably would do it with a validator as shown below:
http://books.zkoss.org/wiki/ZKDeveloper'sReference/MVVM/Data_Binding/Validator
Check out the ShippingDateValidator example.
Best Regards,
Darksu
Asked: 2016-02-19 16:42:46 +0800
Seen: 18 times
Last updated: Feb 20 '16
possible to recreate in a fiddle?
chillworld ( 2016-02-19 19:55:31 +0800 )edit