Bug 138652 - Sorting in Calc by Date
Summary: Sorting in Calc by Date
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
6.3 all versions
Hardware: All Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-12-04 05:11 UTC by saltyla1
Modified: 2020-12-07 19:44 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
An Abbreviated statement of simulated trades (11.56 KB, text/plain)
2020-12-06 18:54 UTC, saltyla1
Details
An Abbreviated statement of simulated trades ODS (21.68 KB, application/vnd.oasis.opendocument.spreadsheet)
2020-12-07 00:12 UTC, saltyla1
Details

Note You need to log in before you can comment on or make changes to this bug.
Description saltyla1 2020-12-04 05:11:53 UTC
Description:
Sorting by Date will not sort properly, and results are only partly sorted. I tried all that I could think of.   Date format  10/2/20 .  Sorted as; 10/19/20 , 10/2/20 , 10/20/20 .

Steps to Reproduce:
1.Use date with format 10/1/20 Through  10/31/20 
2.Insert dates in single column in random order
3.Sort with column in proper date format, Ascending.

Actual Results:
Results abbreviated : 10/1, 10/10, 10/11 - 10/19, 10/2, 10/20, 10/21 - 10/29, 10/3, 10/30, 10/31, 10/4, 10/5, 10/6, etc.

Expected Results:

10/1/20 ,10/2,10/3,10/4,10/5,10/6,10/7,10/8,10/9, 10/10, 10/11 - 10/19, 10/20, 10/21 - 10/29, 10/30, 10/31, etc.


Reproducible: Always


User Profile Reset: Yes


OpenGL enabled: Yes

Additional Info:
LibreOffice  7.0.3.1 (x64)

[Information automatically included from LibreOffice]
Locale: en-US
Module: SpreadsheetDocument
[Information ]
OS: Windows 10
OS is 64bit: yes

Version: 7.0.3.1 (x64)
Build ID: d7547858d014d4cf69878db179d326fc3483e082
CPU threads: 16; OS: Windows 10.0 Build 18363; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL
Comment 1 Martin Srdoš 2020-12-04 08:57:55 UTC
Hello,
thank You for reporting the bug. Unfortunately I can't reproduce this. Works good for me. Are you sure you have tried it in safe mode?

Version: 7.2.0.0.alpha0+ (x64)
Build ID: 4e63ec27b69fa01ff610c894c9fbf05c377a6179
CPU threads: 4; OS: Windows 10.0 Build 18363; UI render: Skia/Raster; VCL: win
Locale: cs-CZ (cs_CZ); UI: en-US
Calc: CL
Comment 2 m_a_riosv 2020-12-04 17:32:25 UTC
Looks as if dates like text in the cells, so they are sorted like any other text.
Please attach a sample file.
Comment 3 saltyla1 2020-12-06 18:54:19 UTC
Created attachment 167879 [details]
An Abbreviated statement of simulated trades

Test was absolutely done in Libre safe mode.
The column was definitely set as date, both as M/D/YY AND MM/DD/YY .
The data comes as date  9/3/20 , not as 09/03/20 .
Comment 4 saltyla1 2020-12-06 18:59:15 UTC
(In reply to srdosm from comment #1)
> Hello,
> thank You for reporting the bug. Unfortunately I can't reproduce this. Works
> good for me. Are you sure you have tried it in safe mode?
> 
> Version: 7.2.0.0.alpha0+ (x64)
> Build ID: 4e63ec27b69fa01ff610c894c9fbf05c377a6179
> CPU threads: 4; OS: Windows 10.0 Build 18363; UI render: Skia/Raster; VCL:
> win
> Locale: cs-CZ (cs_CZ); UI: en-US
> Calc: CL

Test was absolutely done in Libre safe mode.
The column was definitely set as date, both as M/D/YY AND MM/DD/YY .
The data comes as date  9/3/20 , not as 09/03/20 .
Comment 5 m_a_riosv 2020-12-06 19:20:17 UTC
Your file it's a text file, we don't know how you have imported it in the spreadsheet. Please attach the spreadsheet.

If all in one cell per row, no matter how you set up the cell format it is a text.
Comment 6 saltyla1 2020-12-07 00:12:25 UTC
Created attachment 167887 [details]
An Abbreviated statement of simulated trades  ODS

Hope I'm sending the right file this time.
Sorry for any inconvenience.
I checked it again in safe mode, same result.
Comment 7 saltyla1 2020-12-07 01:00:24 UTC
I have found that in the Format Cells dialog window,
Numbers tab, Category "date" > Format , the first 12/31/99 , which
has a format code of M/D/YY is not a match for 12/31/99. It should be
single digit/single digit/double digit , as M/D/YY suggests(I.E. 9/2/99)

I have changed all of the input dates to match MM/DD/YY and it works
for both selections of 12/31/99 .

The second instance of 12/31/99 with format code MM/DD/YY is correct.
Comment 8 Martin Srdoš 2020-12-07 08:08:21 UTC
(In reply to saltyla1 from comment #7)
> I have found that in the Format Cells dialog window,
> Numbers tab, Category "date" > Format , the first 12/31/99 , which
> has a format code of M/D/YY is not a match for 12/31/99. It should be
> single digit/single digit/double digit , as M/D/YY suggests(I.E. 9/2/99)
> 
> I have changed all of the input dates to match MM/DD/YY and it works
> for both selections of 12/31/99 .
> 
> The second instance of 12/31/99 with format code MM/DD/YY is correct.


Hello Saltyla,

you have not the cells in date format. That why the sorting is so. Look to TOOL - OPTIONS - LANGUAGE SETTINGS - LANGUAGE And there is "Date accaptance patterns".  It is format, how you can insert dates. Also select a cell with a date in your document and press F2. There is sign << ' >> in front of the date. It tells to libreoffice "dont format this".

Please check it and tell us, if it works ok.
Comment 9 saltyla1 2020-12-07 19:44:38 UTC
Hello,
I could not change "Date acceptance patterns" from M/D/Y;M/D, it
turned red after adding /YY to it and would not save.
The << ' >> inserted itself when I imported the data. I could
correct the date one cell at a time and the << ' >> would be gone.
So, I went back to importing the data again and found that in the
"Text Import" window that showed up when I pasted the data, the header
 of the date column had a date selection, When set correctly, entered
 the correct date format into the cells without the << ' >> .
I thought (wrongly) this would have been able to be corrected after import.
However, all is well now thanks to your efforts.

Thanks,
Brian