Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_Related Related Topics sp_TopicIcon
Breaking change in DateFormat for non-string value
23/12/2010
13:33
Avatar
ksherratt
New Member
Members
Forum Posts: 2
Member Since:
23/12/2010
sp_UserOfflineSmall Offline

There appears to be a breaking change in the 3.8.2 version of DateFormat function (ln. 128 of jquery.fmatter.js) where the regex tests for a Microsoft format string.  If the object passed as the 'date' parameter is, in fact, a date value the 'match' method is undefined and thus an exception is thrown.

msMatch = date.match(msDateRegExp)

presumably should be qualified for either a string or method existence.  Have patched locally until 3.8.3 is released :)

23/12/2010
15:19
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

Hello ksherratt,

Probably one can fix the bug by changing the line 120 of the jquery.fmatter.js from

msMatch = date.match(msDateRegExp),

to the following

msMatch = ((typedef date === 'string') ? date.match(msDateRegExp): null),

Would the change solve your problem?

Best regards
Oleg

23/12/2010
15:55
Avatar
ksherratt
New Member
Members
Forum Posts: 2
Member Since:
23/12/2010
sp_UserOfflineSmall Offline

OlegK said:

msMatch = ((typedef date === 'string') ? date.match(msDateRegExp): null),

Would the change solve your problem?

s/typedef/typeof/

Yep, that's essentially what I did.

23/12/2010
16:16
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

Thanks! Of course typeof date must be used instead of typedef date.

23/12/2010
20:18
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Thank you,

Will be fixed.

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.

28/01/2011
14:51
Avatar
bakesteve
Member
Members
Forum Posts: 3
Member Since:
22/04/2010
sp_UserOfflineSmall Offline

as a suggestion - perhaps should also allow formatter to fail gracefully?

so in jquery.fmatter line 58:

try {

v = $.fn.fmatter[formatType](cellval, opts, rwd, act); }

catch(ex) { 

if(opts.throwFormatExceptions==true) { throw ex; }

else {

return v;

//just return the original value

}

}

Would also need to add throwFormatExceptions to opts if want to allow fine grained control.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
35 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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information