Bug 88769 - Improper SORTING on the date field for certain date formats
Summary: Improper SORTING on the date field for certain date formats
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.3.5.2 release
Hardware: x86-64 (AMD64) Windows (All)
: medium major
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 88768 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-01-24 09:04 UTC by Jacques
Modified: 2020-11-18 09:43 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jacques 2015-01-24 09:04:38 UTC
OS is Windows 8
Platform: 64 bits

Sorting does not function properly with a date format like day. 01 jan. 1999
Changing the format to 1/jan/1999 eliminates the problem.

The file I am working on is an Excel file I opened with Calc (and for which I am keeping the .xlsx extension).
Comment 1 raal 2015-01-24 09:28:10 UTC
*** Bug 88768 has been marked as a duplicate of this bug. ***
Comment 2 QA Administrators 2016-02-21 08:34:59 UTC Comment hidden (obsolete)
Comment 3 QA Administrators 2017-03-06 15:06:24 UTC Comment hidden (obsolete)
Comment 4 krafczyk.matthew 2017-03-18 19:58:34 UTC
This bug is still present on branch 5.4.0.0.alpha0+ on linux.

To reproduce, open a new Libreoffice Calc doc and enter the following table:

     A        |       B
------------------------------
2017 31 Jan   |       A
2017 10 Feb   |       B
2017 20 Mar   |       C
2017 01 Apr   |       D

Select the 4 cells of column A, and navigate to the 'Format' menu and select 'Cells...'.

Then set the format to Date and enter the format 'YYYY D MMM' pressing the check mark to add the format and set the format of those cells.

Now select all the 8 cells between column A and B and select 'Data' and then 'Sort...'. Then set 'Sort Key 1' to 'Column A' and select either Ascending or Descending.

You will find that the cells are sorted as if they were strings rather than dates.
Comment 5 Xisco Faulí 2017-06-12 12:01:57 UTC
Changing version back to the earliest affected version.
Comment 6 Bruno 2017-08-08 21:12:43 UTC
(In reply to krafczyk.matthew from comment #4)
> This bug is still present on branch 5.4.0.0.alpha0+ on linux.
> 
> To reproduce, open a new Libreoffice Calc doc and enter the following table:
> 
>      A        |       B
> ------------------------------
> 2017 31 Jan   |       A
> 2017 10 Feb   |       B
> 2017 20 Mar   |       C
> 2017 01 Apr   |       D
> 
> Select the 4 cells of column A, and navigate to the 'Format' menu and select
> 'Cells...'.
> 
> Then set the format to Date and enter the format 'YYYY D MMM' pressing the
> check mark to add the format and set the format of those cells.
> 
> Now select all the 8 cells between column A and B and select 'Data' and then
> 'Sort...'. Then set 'Sort Key 1' to 'Column A' and select either Ascending
> or Descending.
> 
> You will find that the cells are sorted as if they were strings rather than
> dates.

Same on V5.4 Win with Date format dd.mm.yyyy. Doesn't sort like a date but just alphabetically.
Comment 7 QA Administrators 2018-08-09 02:35:56 UTC Comment hidden (obsolete)
Comment 8 QA Administrators 2020-08-09 04:08:19 UTC Comment hidden (obsolete)
Comment 9 Keith Gray 2020-11-18 09:43:12 UTC
This bug still exists... Date Format: dd/mm/yyyy
Sort by Column A ascending...

01/11/2010 comes before
02/10/2010