I want to assign date to Date field that is in DD-MM-YYYY
format. That is I receive String Closure_Date
which contains date in DD-MM-YYYY
format. I want to assign that date to Date field like
dtCloseDate.selectedDate=new Date(Closure_Date);
In this case If Closure_Date
contains 16/11/2011
it takes 16 as month so it takes 12 and adds remaining 4 months and it returns 04/11/2012
.
My question is how to assign date(DD-MM-YYYY) to DateField?
If I use Dateformatter(DD-MM-YYYY) like dtCloseDate.selectedDate=new Date(Dateformatter.format(Closure_Date));
It Returns NaN
Assign date to DateField
3.3k Views Asked by Santhosh Nayak At
1
DateField has a handy static stringToDate function that you can use to parse a date with a given format.