Bug 18396 - UK format dates not sorting correctly
Summary: UK format dates not sorting correctly
Status: RESOLVED DUPLICATE of bug 21562
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff interface (show other bugs)
Version: 16.05
Hardware: All All
: P5 - low normal (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-06 22:56 UTC by David Roberts
Modified: 2019-01-14 20:35 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Screenshot showing UK date sorting problem (63.77 KB, application/pdf)
2017-04-06 22:56 UTC, David Roberts
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Roberts 2017-04-06 22:56:47 UTC
Created attachment 61956 [details]
Screenshot showing UK date sorting problem

When you view a user with a large number of checkouts, and you sort the checkouts by date issued, if the system uses UK date format (DD/MM/YYYY) the sorting doesn't working correctly - for example, you might see:

02/02/2017
03/03/2017
08/02/2017
10/01/2017
16/12/2016

instead of the correct order, which would be:

16/12/2016
10/01/2017
02/02/2017
08/02/2017
03/03/2017

See attached screenshot for a real example.
Comment 1 Owen Leonard 2017-04-07 14:54:46 UTC
My favorite method of avoiding date parsing nightmares when sorting is to use the "title-string" option for DataTables.

\koha-tmpl\intranet-tmpl\prog\en\modules\admin\currency.tt:

   30              "columnDefs": [
   31                  { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
   32:                 { "sType": "title-string", "aTargets" : [ "title-string" ] }
   33                  ],
   34          }, columns_settings );

   ..

  208              <th>Symbol</th>
  209              <th>ISO code</th>
  210:             <th class="title-string">Last updated</th>
  211              <th>Active</th>
  212              <th>Archived</th>

   .. 

  223    <td><span title="[% currency.timestamp %]">[% currency.timestamp | $KohaDates %]</span></td>

I don't know if that solution would work with the checkouts table.
Comment 2 Katrin Fischer 2019-01-14 20:35:13 UTC
The checkouts table checkout date sorting issue was fixed by bug 21562.

*** This bug has been marked as a duplicate of bug 21562 ***