UK Date Type Detection - dd/mm/yy
UK Date Type Detection - dd/mm/yy
Hi there,
I'd like to use the automatic type detection to detect UK dates in the format of dd/mm/yy.
I thought I'd found the solution on this site, but I noticed that the UK Date Type Detection plugin (http://www.datatables.net/plug-ins/type-detection) uses dd/mm/yyyy, whilst the closest UK Date sorting plugin I can find (http://www.datatables.net/plug-ins/sorting) uses dd/mm/yy.
Is there a solution that matches up for dd/mm/yy? Or can anyone tell me how I can modify the UK Date Type Detection plugin to detect dd/mm/yy rather than dd/mm/yyyy?
Thanks,
Stephen
I'd like to use the automatic type detection to detect UK dates in the format of dd/mm/yy.
I thought I'd found the solution on this site, but I noticed that the UK Date Type Detection plugin (http://www.datatables.net/plug-ins/type-detection) uses dd/mm/yyyy, whilst the closest UK Date sorting plugin I can find (http://www.datatables.net/plug-ins/sorting) uses dd/mm/yy.
Is there a solution that matches up for dd/mm/yy? Or can anyone tell me how I can modify the UK Date Type Detection plugin to detect dd/mm/yy rather than dd/mm/yyyy?
Thanks,
Stephen
This discussion has been closed.
Replies
[code]
jQuery.fn.dataTableExt.aTypes.unshift(
function ( sData )
{
if (sData !== null && sData.match(/..\/..\/../))
{
return 'date-uk';
}
return null;
}
);
[/code]
Steph
Sorry for the slow response to this - I've only just seen the email notification in my spam folder!
Just tried this and it works a treat, so thanks for your help with this.
It does make me wonder though - what use is the UK Date Type Detection plugin on this site if it doesn't have a matching sorting plugin, like the one you've provided above? I'm probably missing something. :-)
Thanks again,
Stephen
Steph
Thanks for the clarification on that one. :-)
Thanks,
Stephen