You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm trying to sort a time column and ran into small issue. Basically, the hours in my time are zero padded to two digits (eg. 09:52 PM) and tablesorter doesn't seem to handle that. After digging through the code, I think isolated to source to the regex used in the time parser. Below are the lines in question:
// match 24 hour time & 12 hours time + am/pm - see http://regexr.com/3c3tk
ts.regex.timeTest = /^([1-9]|1[0-2]):([0-5]\d)(\s[AP]M)$|^((?:[01]\d|[2][0-4]):[0-5]\d)$/i;
ts.regex.timeMatch = /([1-9]|1[0-2]):([0-5]\d)(\s[AP]M)|((?:[01]\d|[2][0-4]):[0-5]\d)/i;
I checked out the url at regexr.com and noticed that it failed to match the last time of "09:59 PM". Is that the correct behavior? Is it possible to update the regex to also handle zero padded hours by adding 0? like so:
Hi, I'm trying to sort a time column and ran into small issue. Basically, the hours in my time are zero padded to two digits (eg. 09:52 PM) and tablesorter doesn't seem to handle that. After digging through the code, I think isolated to source to the regex used in the time parser. Below are the lines in question:
I checked out the url at regexr.com and noticed that it failed to match the last time of "09:59 PM". Is that the correct behavior? Is it possible to update the regex to also handle zero padded hours by adding
0?
like so:The text was updated successfully, but these errors were encountered: