[Libreoffice-bugs] [Bug 144359] LibreOffice allows entry of wrong dates for format

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Wed Sep 8 17:01:13 UTC 2021


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

--- Comment #5 from Mike Kaganski <mikekaganski at hotmail.com> ---
In other words:

You need to understand, that cell format is *not* intended to define "what
values a cell may contain"; it is *only* to define "what procedure to use when
show the *existing* content of the cell on screen/on paper".

I.e., when you type characters in a cell, the format string does *NOT* (and is
not designed to!) affect what you *may* enter into the cell (i.e., it is not a
filter). *Any* cell in a spreadsheet, however formatted, may contain any data -
it may be numeric, or textual; it may be a calculated formula returning text,
or number, or error.

The formatting of a cell does participate in conversion of your typed text to
the cell content. But its part is just to be a *hint* to the program what to
attempt, not a filter: i.e., a date format of the active cell might give a hint
in which order the date parts (year/month/day) might go in the input string.
But if the hint derived from the format does not match the input, the *correct*
behavior of the program is to fallback to the most reliable result: accept the
typed characters not as some converted number (which dates are), but as plain
text. There is *NO* "invalid" text: just anything that you may type is a valid
text string, and must be accepted as a valid cell content.

What you are talking about is *validation* of input; and as Uwe and I informed
you, there is a dedicated tool for *validation*. What you suggest is using a
wrong tool for the task: you try to use cell format for the validation task,
for which there is Validity.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20210908/8a04b05c/attachment.htm>


More information about the Libreoffice-bugs mailing list