Bug 157973 - cell data will not accept date format
Summary: cell data will not accept date format
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.4.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-10-29 20:23 UTC by antifascist
Modified: 2023-11-06 03:16 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
sample data demonstrating this bug (9.93 KB, application/vnd.oasis.opendocument.spreadsheet)
2023-10-29 20:23 UTC, antifascist
Details

Note You need to log in before you can comment on or make changes to this bug.
Description antifascist 2023-10-29 20:23:43 UTC
Created attachment 190499 [details]
sample data demonstrating this bug

sometimes when you import data into a spreadsheet, some cells get imported as plain text, and it is subsequently impossible to convert those cells into the correct format.

Please note:  Any solution which involves different user input during the import process, is not a solution to the present bug, because the original data source may no longer be available therefore it may not be possible to try the import process again.

The attached file provides an example of imported data.  There is nothing special about this data, but due to some bug, Libre Office is treating this data differently than it normally does.

For whatever reason, it is not possible to format the attached data as a date.

When the cell containing Aug 27, 2016 is formatted as a date, the cell changes to 'Aug 27, 2016 instead of changing to 08/27/16.  If the user types Aug 27, 2016 into a random cell, then that random cell becomes formatted as a date.  However, if the user copies the cell containing Aug 27, 2016 and then pastes the result into a random cell, then that random cell does not become formatted as a date.
Comment 1 benblock88 2023-11-02 19:51:37 UTC
I have reproduced this bug with the attached file.

Something of note: when I change the formatting of the cells with written dates to the "date" format and then click on one of those cells, the input line at the top shows an apostrophe (') that wasn't there prior to changing the formatting of the cell. When I delete this apostrophe then the cell correctly formats to the mm/dd/yy format that the user expects.
Comment 2 ady 2023-11-02 23:05:02 UTC
Tools > Options > Language Settings > Languages > Date acceptance patterns.

Additionally, when importing the plain text data, you can select each column (while still in the import dialogue) and select which type of data each column includes. Some of the options are D/M/Y, M/D/Y and others (instead of the standard text or numeric types of values). Once the data is correctly recognized as "date" after it was imported, the displayed format can be modified, for example as 'MMM DD, YYYY'.

IMHO, this is a question for https://ask.libreoffice.org and for reading the official Help content; NAB.

If I am misunderstanding the report, please provide a source data (as text or csv file) to be imported, (as opposed to the resulting spreadsheet).
Comment 3 antifascist 2023-11-06 00:11:28 UTC
> 
> IMHO, this is a question for https://ask.libreoffice.org and for reading the
> official Help content; NAB.
> 

Could you please explain why it is your opinion that the described behavior would not be a bug?  It is my opinion that it should be possible to format a cell as a date when the text contained in that cell is clearly a date.  Why should this not be possible?  Do you not believe that "Aug 27, 2016" is a date?  It certainly looks like a date to me.

> If I am misunderstanding the report, please provide a source data (as text
> or csv file) to be imported, (as opposed to the resulting spreadsheet).

This bug exists in the spreadsheet I have provided.  This is not a bug with the import process.  This is a bug with the process of formatting a cell.  I am formatting the cell by right-clicking on the cell, choosing "Format Cells..." , clicking on the "Numbers" tab, and selecting the "Date" category.
Comment 4 ady 2023-11-06 03:16:10 UTC
(In reply to antifascist from comment #3)
> This bug exists in the spreadsheet I have provided.

That is not the same as:
(In reply to antifascist from comment #0)
> Created attachment 190499 [details]
> sample data demonstrating this bug
> 
> some cells get imported
> as plain text, and it is subsequently impossible to convert those cells into
> the correct format.

Explaining why this is NAB (IMO), or how to achieve what you want to achieve, should be done at sites such as https://ask.libreoffice.org and not here, where real bugs should be reported.

My intention is not to sound rude or somewhat not nice, but rather to leave the focus of this site exclusively for bug reports. I'm sure someone at the ask site will be able to explain how to achieve what you want.

Having said that, I could be wrong, and maybe someone else thinks this is indeed a valid report of a real bug. Therefore, I am not closing this report as NAB, leaving it for others to either answer your questions/doubts, or setting this report in any other way. Maybe someone would come up with a fix to your report too.

As a hint, if you import data as text, changing the cell format after the data is already in the cell(s) will not modify the data itself; only the way it is displayed. You need to modify the way the data is imported, in order to be detected as date; then you can modify the format in which such date is presented.