-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Sometimes dates inserted in Datebox Component are changed without any warning or error message. For example, working with a Datebox with lenient set to "false" and date format set to "yyyy/MM/dd", you get this output:
We expected the system displayed error message in the first case and accepted the dates inserted without changing them in the other cases. Is there any way to fix it? Do you have any suggestion to manage it?
Hello assimoco,
It seems that the component is trying to auto correct the value
Could you please apply the following code in order to solve the issue...
Datebox box = new Datebox();
box.setLenient( false );
box.setConstraint( "before 20380101" );
*Set the constraint to a desired value.
Furthremore you can check out the constraint section of the following url and use the no past constraint:
http://books.zkoss.org/wiki/ZKComponentReference/Input/Datebox
Best Regards,
Darksu
Hi Darksu, thanks for your answer!
My problem is I need to accept the dates "0001/11/30" and "0100/11/30" as valid.
I tried your suggestion about constraints with the following code:
<zk>
<hlayout>
<space spacing="200px" />
<vlayout>
<separator spacing="200px" />
<datebox id="datebox" cols="12" format="yyyy/MM/dd" />
</vlayout>
</hlayout>
<zscript><![CDATA[
datebox.setLenient( false );
datebox.setConstraint( "between 00010101 and 99991231" );
]]></zscript>
</zk>
Unfortunately the constraint lower value is automatically converted in "20010101"...
Asked: 2014-08-04 18:10:05 +0800
Seen: 65 times
Last updated: Aug 12 '14