I have a DateTimeField on my form, regardless of what I put in Display Pattern, Edit Pattern, Data Pattern, or Validation Pattern, whenever I retrieve the rawValue in javascript code it shows as "YYYY-MM-DD".
One of the reasons this is a problem is that I need to see if the entry in this field is a Thursday. The way I would normally do this is something like:
var datStartDate = new Date(frmODTMainPage.txtDateAdRuns.rawValue);
if (datStartDate.getDay() == 4)
{
//It's a Thursday
}
The problem is that if Date() receives a string in the form "YYYY-MM-DD" it throws an "Invalid Date" error.
I could spend time parsing the rawValue and creating a new variable that has the date in the format javascript likes, but I think it is a bit wierd that a datefield would output the date in a format that is not compatible with how javascript expects dates to be formated.
So, is there a setting somewhere that I am missing that is causing this behavior?
Thanks.