-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi,
I want to let the "to" date be after the "from" date, and I have two databox as following, so can anyone tell me how to constrain the "to" date be after the "from" date?
<vbox align="end">
<hbox>
<label value="From: " />
<datebox id="from" format="yyyy-MM-dd HH:mm:ss" width="120px" readonly="true" constraint="between 20100401 and 20101231" />
</hbox>
<hbox>
<label value="To: " />
<datebox id="to" format="yyyy-MM-dd HH:mm:ss" width="120px" readonly="true" constraint="between 20100401 and 20101231" />
</hbox>
</vbox>
thanks a lot. ^_^
Hi yuanbohan
the following example works fine for me.
<zscript><![CDATA[ import java.text.SimpleDateFormat; void fromChanged(){ SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); to.setConstraint("between " + sdf.format(from.getValue()) + " and 20101231" ); } ]]> </zscript> <vbox align="end"> <label value="From: " /> <datebox id="from" format="yyyy-MM-dd HH:mm:ss" width="120px" readonly="true" constraint="between 20100401 and 20101231" onChange="fromChanged()/> </hbox> <hbox> <label value="To: " /> datebox id="to" format="yyyy-MM-dd HH:mm:ss" width="120px" readonly="true" constraint="between 20100401 and 20101231" /> </hbox> </vbox>
please try it.
Masuji
Asked: 2010-04-08 14:38:57 +0800
Seen: 447 times
Last updated: Apr 14 '10