Hello,
I am trying to use a velocity expression to make sure that a certain date falls after the current date. I have gone trough the documentation that I could find (http://www.smartclient.com/smartgwte...tySupport.html and http://www.smartclient.com/smartgwte...erverCondition) but found nothing that could help me in the area of type conversion (string to date) or date comparison (compare two dates and determine the current date in some way).
I tried the following ($value yields a string value):
(was not working - syntax error - I expect because the $date utility is not known in the velocity scope)
and also desperatly:
(Lexical error)
I would greatly appreciate any reference to a sample or piece of documentation to get this working.
for your reference, the full validator XML looks like this:
We are on the latest 2.5 build.
thanks a lot in advance.
I am trying to use a velocity expression to make sure that a certain date falls after the current date. I have gone trough the documentation that I could find (http://www.smartclient.com/smartgwte...tySupport.html and http://www.smartclient.com/smartgwte...erverCondition) but found nothing that could help me in the area of type conversion (string to date) or date comparison (compare two dates and determine the current date in some way).
I tried the following ($value yields a string value):
Code:
$value<=$date.calendar
and also desperatly:
Code:
$value.date.compareTo('2011-08-12 00:00:00')<=0
I would greatly appreciate any reference to a sample or piece of documentation to get this working.
for your reference, the full validator XML looks like this:
Code:
<validator stopIfFalse="false" stopOnError="false" type="serverCustom" validateOnChange="true"> <serverCondition><![CDATA[$value.compareTo('2011-08-12 00:00:00')<=0']]></serverCondition> <errorMessage>An unexpected error occured: The incident date must be a future date.</errorMessage> </validator>
We are on the latest 2.5 build.
thanks a lot in advance.
Comment