Hello All,
I have several date/time fields in my form on which i'm performing some date validations based on certain events.
I have a strange problem while performing validations. If user selects the date from the dropdown calendar for the fields, then the validations are working fine. But if the user manually enters the date, then validations are not working.
I'm using javascript for the validation and i'm using [b]util.scand()[/b] function inside the script.
i did some investigation on its behaviours, and some of the things are:
-> By default, date/time converts the selected date to 'YYYY-MM-DD' format ([b]Can I change this to other format?[/b]) . So i'am using
var Date1 = Form.PAGE2.DEAL.TermTo.rawValue; var fromDate = util.scand("yyyy-mm-dd", Date1);
scand() will return a valid date.
-> If user enters a value on the fileld, eg: 'DD-MM-YYYY', the field is not converting to the usual format. And obviously scand() is retuning NULL as the date is not in the expected format.
I want to have both the selection of date as well as manual entry and i fix to a particular format, eg:'DD-MM-YYYY'.
Can I do that?
Thanks in advance
Deepak
Are you getting any errors in LiveCycle Designer or the JavaScript debugging console?
Why not use the date time functions of LiveCycle Designer?
The purpose of the 'util.scand()' function is to convert a date or time into JavaScirpts data time object which can be converted into the time from the Epoch date in milliseconds and it is not supported by LiveCycle Designer. Do you need the date expressed in milliseconds?
George Kaiser