https://bugs.documentfoundation.org/show_bug.cgi?id=165614

            Bug ID: 165614
           Summary: A value being a date or a time must not be considered
                    formatting
           Product: LibreOffice
           Version: Inherited From OOo
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Calc
          Assignee: [email protected]
          Reporter: [email protected]

When I type in a date or time value in LibreOffice - not by formatting a cell,
but by typing in, say, 2025-03-06 or 15:31 - I expect LibreOffice to recognize
the nature of this input, i.e. keep track of it being a date value or time
value.

However, if I select a cell into which I've entered a date or time value, then
on the menus choose Edit > Clear Direct Formatting - the date is converted into
an integral number (in the case of a date) or a fractional one (in case of time
or date-time); for example, 45722 and 0.646527777777778 for the date and the
time I mentioned above.

This is a bug. That is, the date-ness, or date-nature, of what I've entered is
not an aspect of its formatting. The question of how to display it, i.e. as
YYYY-MM-DD, days since some epoch, or something else - that's formatting. Now,
unless the default format for a date is days-since-epoch (which I don't know to
be the case) - there is no reason why clearing direct formatting would reformat
2025-03-06 and 45722.

Specifically, as a user, while I did choose some date format to enter my date
in, which could be construed as a formatting choice - I most definitely did not
intend to enter 45722 with some direct formatting. It is almost certainly
against my intent and my needs to change 2025-03-06 into 45722 when I want to
clear DF such as spacing, font, vertical placement and number formatting
(unlike, say, changing 2025-03-06 to 03/06/25 because that's the default date
format for my locale, or whatever).

No less importantly - the saved ODT file must indicate this value as a date,
not just an arbitrary number. This is not what happens. Saving as an FODT, we
get (in addition to a large amount of boilerplate/junk):

  <office:spreadsheet>
   <table:calculation-settings table:automatic-find-labels="false"
table:use-regular-expressions="false" table:use-wildcards="true"/>
   <table:table table:name="Sheet1" table:style-name="ta1">
    <table:table-column table:style-name="co1"
table:default-cell-style-name="Default"/>
    <table:table-row table:style-name="ro1">
     <table:table-cell office:value-type="float" office:value="45722"
calcext:value-type="float">
      <text:p>45722</text:p>
     </table:table-cell>
    </table:table-row>
   </table:table>
   <table:named-expressions/>
  </office:spreadsheet>

So, a float value of 45722. That is not the user intended to put in their
spreadsheet.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to