This content has been marked as final. Show 6 replies
You can use a dateformatter for that.
var dateObject:Date = valueDateFormat.format(yourDate);
If I do that I get
1067: Implicit coercion of a value of type String to an unrelated type Date.
"nikos101" <firstname.lastname@example.org> wrote in message
> If I do that I get
> 1067: Implicit coercion of a value of type String to an unrelated type
Just use the split() method of the string object to break the date into its
component parts, then use those to create the date. The problem might be if
you expect to get several different date formats, but you can control this
by telling the user which format to use next to the text input (dd/mm/yyyy).
The implicit coercion error is because it was expecting a date object but you gave it a string (date from your textinput) If you cast it as a date it shouldn't give you any problems.
var dateObject:Date = valueDateFormat.format(yourDate as Date);
ok cheers Ventis