Bug 135541 - Dates are entered inconsistently, switching between day and month.
Summary: Dates are entered inconsistently, switching between day and month.
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
6.4.5.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Number-Format
  Show dependency treegraph
 
Reported: 2020-08-07 17:58 UTC by jteera5
Modified: 2023-04-24 16:18 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample file for test purpose. (11.33 KB, application/vnd.oasis.opendocument.spreadsheet)
2020-08-08 16:17 UTC, jteera5
Details
Format Cells dialog box (153.20 KB, image/png)
2020-08-09 16:15 UTC, jteera5
Details
Calc screenshot and Linux language settings. (149.33 KB, image/png)
2020-08-11 16:24 UTC, jteera5
Details
Screenshot: language settings that cause the bug (77.19 KB, image/png)
2021-05-30 02:28 UTC, Korrawit Pruegsanusak
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jteera5 2020-08-07 17:58:06 UTC
Description:
In a cell with format code "[~buddhist]D MMM YYYY" or "DD/MM/YYYY" and "Thai" language, when a date is entered the first time (e.g. 3/6), the date 6 Mar 2020 is entered. Then if the same date is enter again (3/6) into the same cell, the date 3 Jun 2020 is entered. This is inconsistent and confusing.
In former versions of Calc, when 3/6 is entered it's always 3 Jun of the current year.


Steps to Reproduce:
1.Enter 3/6 into a cell with format code [~buddhist]D MMM YYYY
2.Enter 3/6 into the same cell again.
3.

Actual Results:
1. 6 Mar is entered. (6 มี.ค. 2563 is shown)
2. 3 Jun is entered. (3 มิ.ย. 2563 is shown)


Expected Results:
3 มิ.ย. 2563


Reproducible: Always


User Profile Reset: No



Additional Info:
The software should accept dates according to the local format.
Comment 1 m_a_riosv 2020-08-08 00:45:21 UTC
Please attach a sample file for test purposes.
Comment 2 jteera5 2020-08-08 16:17:07 UTC
Created attachment 164052 [details]
Sample file for test purpose.

My OS is Linux Mint 20. I think the problem started after I upgraded from Linux Mint 18 to Linux Mint 19. The problem still exists in Linux Mint 20.
Comment 3 QA Administrators 2020-08-09 04:09:20 UTC Comment hidden (obsolete)
Comment 4 m_a_riosv 2020-08-09 11:23:01 UTC
Works fine for me, maybe because my predetermined language is Spanish. But even changing in default style to 'English US', works fine for me too.
Comment 5 jteera5 2020-08-09 16:15:03 UTC
Created attachment 164072 [details]
Format Cells dialog box

Please try to set the cell's format as shown in the attachment, including setting the language to Thai.
Comment 6 m_a_riosv 2020-08-10 06:43:31 UTC
Again works fine for me.
Comment 7 jteera5 2020-08-11 16:24:39 UTC
Created attachment 164172 [details]
Calc screenshot and Linux language settings.

The attachment shows Calc screenshot with Linux language settings. Hope this will help with confirmation of the problem. Format day/month/year is commonly used in Thailand.
Comment 8 jteera5 2020-08-11 16:27:38 UTC
The problem does not occur in Windows. 3/6/20 is always entered as 3 Jun 2020 with my locale settings.
Comment 9 m_a_riosv 2020-08-12 09:13:15 UTC
Please test if using 03/06 has the same problem as 3/6.

I have not Linux for test.
Comment 10 jteera5 2020-08-12 13:28:18 UTC
(In reply to m.a.riosv from comment #9)
> Please test if using 03/06 has the same problem as 3/6.
> 
> I have not Linux for test.

Yes, Calc on Linux Mint using 03/06 has the same problem as 3/6.
Comment 11 jteera5 2020-09-19 10:50:22 UTC
(In reply to m.a.riosv from comment #9)
> Please test if using 03/06 has the same problem as 3/6.
> 
> I have not Linux for test.

You can install a Linux distribution (Linux Mint in my case) on a USB drive and boot from the USB drive without installing it on your harddisk. It should be convenient enough to confirm the issue.
Comment 12 Korrawit Pruegsanusak 2021-03-27 18:27:35 UTC
Thank you for reporting the problem.

However, using Ubuntu 18.04 and Thai locale, I cannot confirm this bug in:
Version: 6.4.4.1
Build ID: b50bc319eca5cd5b66fbfe2ebd0d3bd1eed099b5
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: th-TH (en_US.UTF-8); UI-Language: en-US
Calc: threaded

Entering 3/6 resulted in "3 มิ.ย. 2564"(*) all the times.
(*) I test this on the year 2021 (2564 BE), so the result is correct.

Could you please check this on your system?
Tools > Options > Language Settings > Languages > Date acceptance patterns.
Mine is "D/M/Y;D/M"
Comment 13 Korrawit Pruegsanusak 2021-05-30 02:28:06 UTC
Created attachment 172449 [details]
Screenshot: language settings that cause the bug

CONFIRMED; Ubuntu 20.04
Version: 7.1.2.2 / LibreOffice Community
Build ID: 8a45595d069ef5570103caea1b71cc9d82b2aae4
CPU threads: 4; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

with the language settings as attached in the screenshot.

Note that the date acceptance patterns are "M/D/Y;M/D".

This is a bug because the input result should be consistent.
IMHO, inputting "3/6" should result in "March 6" per date acceptance patterns, not "June 3" per cell formatting; but this might be debatable.
Comment 14 Korrawit Pruegsanusak 2021-05-30 02:30:03 UTC
CONFIRMED per comment 13.
Comment 15 jteera5 2023-03-02 10:20:51 UTC
This issue had been solved but it came back again in Windows version of LO v.7.4.5.1
Linux version is working consistently.
Comment 16 Eike Rathke 2023-04-24 16:12:25 UTC
(In reply to Korrawit Pruegsanusak from comment #13)
> This is a bug because the input result should be consistent.
> IMHO, inputting "3/6" should result in "March 6" per date acceptance
> patterns, not "June 3" per cell formatting; but this might be debatable.
It exactly is.. there was a requirement that the cell format's locale should be taken into account when editing a date, because that is how it's current content is displayed. Entering a date on a blank cell the LibreOffice locale is used (because otherwise one would have to lookup the actual format's locale each time before), which with en-US has a M/D date acceptance pattern. For Thai the date edit format is DD/MM/YYYY so typing again in the not anymore blank cell the D/M pattern is accepted.