Bug 108245 - Change column format to "Date" adds ' to the beginning of field
Summary: Change column format to "Date" adds ' to the beginning of field
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.3.3.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-05-30 13:16 UTC by Eduardo
Modified: 2017-06-01 14:14 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
CSV File (1.37 KB, text/plain)
2017-05-30 13:16 UTC, Eduardo
Details
Import dialog (default) (20.84 KB, image/png)
2017-05-30 20:43 UTC, Eduardo
Details
appearance after import (everything ok) (81.79 KB, image/png)
2017-05-30 20:44 UTC, Eduardo
Details
Change column type dialog (default) (22.91 KB, image/png)
2017-05-30 20:45 UTC, Eduardo
Details
After column type change (error, see red square) (88.00 KB, image/png)
2017-05-30 20:47 UTC, Eduardo
Details
a way to reproduce. (17.19 KB, application/vnd.oasis.opendocument.spreadsheet)
2017-06-01 14:14 UTC, Jacques Guilleron
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eduardo 2017-05-30 13:16:34 UTC
Created attachment 133724 [details]
CSV File

1. Import CSV File
2. Change first column to date "DD/MM/YYYY"
3. Order column by date

Dates are ordered as a string, because an ' is appended to the beginning.

If ' is removed, calc orders the column correctly.
Comment 1 Jacques Guilleron 2017-05-30 14:54:39 UTC
Hi Eduardo,

I didn't reproduce with
LO 5.3.3.2 Build ID: 3d9a8b4b4e538a85e0782bd6c2d430bafe583448
Threads CPU : 2; Version de l'OS :Windows 6.1; UI Render : par défaut; Moteur de mise en page : nouveau; Locale : fr-FR (fr_FR); Calc: CL

"Detect special numbers" was it ticked when you imported the datas?
Comment 2 Eduardo 2017-05-30 20:43:17 UTC
Created attachment 133731 [details]
Import dialog (default)
Comment 3 Eduardo 2017-05-30 20:44:19 UTC
Created attachment 133732 [details]
appearance after import (everything ok)
Comment 4 Eduardo 2017-05-30 20:45:05 UTC
Created attachment 133733 [details]
Change column type dialog (default)
Comment 5 Eduardo 2017-05-30 20:47:02 UTC
Created attachment 133734 [details]
After column type change (error, see red square)
Comment 6 Eduardo 2017-05-30 20:54:28 UTC
Hi Jacques, thanks for taking time to verify this.

I've added 4 attachments.

1. CSV file you need to open
2. Import dialog (in spanish)
3. Calc after importing the file ( appearance after import )
4. Change column type dialog
5. Appearance after changing the column type

You will see the dates correctly in the cell, but if you see the formula you will see that the dates are appended with '.

Ex: DD/MM/YYYY => 'DD/MM/YYYY

Hope you can reproduce this error.

Answering your question:
I've tried with those options checked and unchecked it doesn't change anything, imported file results in the same output.
Comment 7 Jacques Guilleron 2017-05-30 21:34:23 UTC
Thanks. Just Untick "Quoted field as text" -> "Campo entrecomillado como texto"
in the import dialog.
That's why I didn't reproduce.

Jacques
Comment 8 Eduardo 2017-05-30 22:27:25 UTC
Hi Jacques, first of all thanks! can i buy you a beer? 

I would like to know if it's an expected behaviour?

If a quote is added in the field when importing the CSV, it should appear clearly in the cell, like '12/05/2017 and not once the user has changed the cell type?

Thanks!
Comment 9 Eduardo 2017-05-30 22:28:22 UTC
Forgot to change status
Comment 10 Jacques Guilleron 2017-06-01 14:14:20 UTC
Created attachment 133785 [details]
a way to reproduce.

This is the usual behaviour.
Most of the time, those apostrophes (simple quote marks) are added when we import table from web or a database.
They are texts and, with or without apostrophe, they are aligned to left.
This behaviour can be reproduce. I joined a document to show how it works.
Column A was first text formated and filled next with numbers.
Column B is a copie of column A, but an apostrophe was automaticly added at the copie time.
Column D is get from column C by a formula, and give also a quoted column E by copie.
Column B as column E can be transform to values by selecting them and
Data > Text to columns…
Another way to do that is to multiply by 1
or use a formula like =VALUE()

Ok for the beer the next time we meet.

Jacques