Forum
18:08
19/02/2010
My dates are being returned from the server via JSON in this format: "March, 31 2009 14:41:25"
I setup the formatoptions.srcformat on my date column as 'F, d Y H:i:s' and the formatoptions.newformat as 'm/d/Y'
My result is 01/31/2009, but should be 03/31/2009.
I have tracked the issue down to the jquery.fmatter.js file, lines 110 - 126. I found several issues.
1) Line 110 & 111: The regex for date & format variables does not account for a comma. Adding \, seems to address this.
2) Line 119 & 120: Nothing ever uses the 'dM' variable. I altered this to instead set the result to 'date[k]'.
3) Line 120: Adding +1 to the numeric month gives incorrect result. JS months are zero based 0-11. I removed the +1.
4) Line 126: In my format, I did not use 'm', I used 'F'. There is no code to set 'm' from 'F' once the numeric month has been determined. I added a line before this of 'if (ts.f) {ts.m = ts.f;}'.
Making these 4 alterations addresses the issue I found.
Thanks
12:12
Moderators
30/10/2007
Hello,
Thanks for 1,2 and 4. Fixed.
The 3) is not true. below these lines later we decrement the mouth value.
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
Most Users Ever Online: 715
Currently Online:
25 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66