Bug 139440 - Calc 'Sort Ascending' does not properly sort when the field is date by mm/dd/yyyy
Summary: Calc 'Sort Ascending' does not properly sort when the field is date by mm/dd/...
Status: RESOLVED INSUFFICIENTDATA
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-06 02:06 UTC by john.oliver.3
Modified: 2021-08-06 03:46 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
.csv file to demonstrate improper data sort (data ascending). (141 bytes, application/vnd.ms-excel)
2021-01-06 02:09 UTC, john.oliver.3
Details

Note You need to log in before you can comment on or make changes to this bug.
Description john.oliver.3 2021-01-06 02:06:58 UTC
Description:
A csv file when opened in LibreOffice Calc did not properly sort ascending. Specifically, the target column with header "Date" and values as mm/dd/yyyy sorted as 01/01/2021, ... 01/05/2021, 03/01/2020, 03/02/2020 ... 12/31/2020.
The proper sorting should be 03/01/2020, 03/02/2020 ... 12/31/2020, 01/01/2021, ... 01/05/2021. That is, 2021 is being placed before 2020.
Thank you. 

Steps to Reproduce:
1.Open attached Calc file: Test_Sort.csv
2.Choose 'Data'-> 'Sort Ascending' on "Date column" 


Actual Results:
Dates with year 2021 are ordered before dates with year 2020

Expected Results:
Dates with year 2020 should precede dates with year 2020 as referenced to increasing row number.


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.0.3.1 (x64)
Build ID: d7547858d014d4cf69878db179d326fc3483e082
CPU threads: 8; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded
Comment 1 john.oliver.3 2021-01-06 02:09:39 UTC
Created attachment 168715 [details]
.csv file to demonstrate improper data sort (data ascending).
Comment 2 Ming Hua 2021-01-06 05:57:05 UTC
When opening the .csv file, did you import the "Date" column as "Date (MDY)" format, or did you just leave it as "Standard" format?

If you don't specify its format and just import as "Standard", it will be imported as text, and of course will be sorted as text strings, not as dates.

(In reply to john.oliver.3 from comment #1)
> Created attachment 168715 [details]
> .csv file to demonstrate improper data sort (data ascending).
This sample file sorts correctly, 2021 dates after 2020 dates, if I specify "Date" format when importing.
Comment 3 QA Administrators 2021-07-06 04:00:32 UTC Comment hidden (obsolete)
Comment 4 QA Administrators 2021-08-06 03:46:25 UTC
Dear john.oliver.3,

Please read this message in its entirety before proceeding.

Your bug report is being closed as INSUFFICIENTDATA due to inactivity and
a lack of information which is needed in order to accurately
reproduce and confirm the problem. We encourage you to retest
your bug against the latest release. If the issue is still
present in the latest stable release, we need the following
information (please ignore any that you've already provided):

a) Provide details of your system including your operating
   system and the latest version of LibreOffice that you have
   confirmed the bug to be present

b) Provide easy to reproduce steps – the simpler the better

c) Provide any test case(s) which will help us confirm the problem

d) Provide screenshots of the problem if you think it might help

e) Read all comments and provide any requested information

Once all of this is done, please set the bug back to UNCONFIRMED
and we will attempt to reproduce the issue. Please do not:

a) respond via email 

b) update the version field in the bug or any of the other details
   on the top section of our bug tracker

Warm Regards,
QA Team

MassPing-NeedInfo-FollowUp