With the older tablesorter plugin you could specify the UK date format: $("#issuest").tablesorter({[% IF ( dateformat_metric ) %] dateFormat: 'uk',[% END %]... It doesn't look like DataTables has this option built in.
Created attachment 13493 [details] [review] Bug 9061 - DataTables date sort does not work with date in uk format (dd/mm/yyyy) The DataTables plugin doesn't include native support for sorting date in uk/euro format (dd/mm/yyyy). This patch adds a plugin to be optionally included in cases where the Koha dateformat preference is set to "metric." The patron circulation history page is the only page affected by this patch. If it is found to be working well I will submit follow-ups to cover other instances where sorting by date occurs. To test, load the patron circulation history page (members/readingrec.pl) for a patron with a circulation history. Sorting by "date," "checked out on," "date due," and "Return date" should work correctly with under all three dateformat settings.
Created attachment 13494 [details] [review] [Signed off] Bug 9061 - DataTables date sort does not work with date in uk format (dd/mm/yyyy) The DataTables plugin doesn't include native support for sorting date in uk/euro format (dd/mm/yyyy). This patch adds a plugin to be optionally included in cases where the Koha dateformat preference is set to "metric." The patron circulation history page is the only page affected by this patch. If it is found to be working well I will submit follow-ups to cover other instances where sorting by date occurs. To test, load the patron circulation history page (members/readingrec.pl) for a patron with a circulation history. Sorting by "date," "checked out on," "date due," and "Return date" should work correctly with under all three dateformat settings. Signed-off-by: Melia Meggs <melia@test.bywatersolutions.com>
To test, I set dateformat to dd/mm/yyyy. Before applying patch, the patron's circulation history showed in this date order: 12/03/2012 (March 12, 2012) 13/09/2012 (September 13, 2012) 14/06/2012 (June 14, 2012) After applying the patch, the patron's circulation history was correctly ordered by date. I also checked that "checked out on," "date due," and "return date" all sort in correct date order as well.
Hi Owen, Your patch works. But do you know a (quite) similar function already exist (dt_add_type_uk_date in js/datatables.js)? (see booksellers.tt and aqbugetperiods.tt for example). This function does not handle hours in date but maybe we could regroup both functions (file, function name, etc.)?
Why has this been marked as resolved invalid? It seems to me like this is still something that is needed...
(In reply to David Cook from comment #5) > Why has this been marked as resolved invalid? > > It seems to me like this is still something that is needed... Nevermind. Answered my own question: Bug 9108