Download it now!
Bug 44636 - FORMATTING: NF-DATE: match input against date acceptance patterns to recognize as date
Summary: FORMATTING: NF-DATE: match input against date acceptance patterns to recogniz...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Master old -3.6
Hardware: All All
: medium major
Assignee: Eike Rathke
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-10 07:09 UTC by Eike Rathke
Modified: 2012-01-21 16:43 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eike Rathke 2012-01-10 07:09:52 UTC
Scanning cell input is very lax regarding dates and recognizes much too many patterns as "valid" dates, especially when it comes to abbreviated (incomplete) dates, for example:

en-US: M/D is valid (day of month of current year), but also accepted is M/D/ and M.D and M.D.
de-DE: D.M. is valid, but also accepted is D.M and D/M and D/M/
Any mixture of '.' '/' '-' (plus the locale's date separator if it differs) is accepted, e.g. 22.11/99 in a locale's DMY order.

In many cases this leads to forced dates if in fact the input should be treated as text instead.

Implement a match against locale dependent date acceptance patterns to form a valid date. Additionally, ISO 8601 yyyy-mm-dd input must still be valid in every locale, a match against an already applied date format should be recognized as well, if not contradicting.
Comment 1 Eike Rathke 2012-01-11 04:24:35 UTC
Implemented in master:
http://cgit.freedesktop.org/libreoffice/core/commit/?id=958cdbdcf5e35c04e259a69e972684060f1b3d12
http://cgit.freedesktop.org/libreoffice/core/commit/?id=8298a4741d95034f65c648dddfae081f44cf9455
http://cgit.freedesktop.org/libreoffice/core/commit/?id=f6c465e3555c8ac9d2902b3ac35f2d4784eed4c9
http://cgit.freedesktop.org/libreoffice/core/commit/?id=8b7354217de215a972341414c8a693bdfbfd13af
http://cgit.freedesktop.org/libreoffice/core/commit/?id=5c81423cc06a907da34d6954732ac5b405ab8296
http://cgit.freedesktop.org/libreoffice/core/commit/?id=ed5882352207f25bdc8aeeb515c8d5ed39211ac1
http://cgit.freedesktop.org/libreoffice/core/commit/?id=899fe10b72522c833b7dc03312284db470952a28
http://cgit.freedesktop.org/libreoffice/core/commit/?id=67edfdce616c6dc56395e05a09e098a0460b9313
http://cgit.freedesktop.org/libreoffice/core/commit/?id=b75958473503f7eca096b8843e57a031bbabe0ab
http://cgit.freedesktop.org/libreoffice/core/commit/?id=ee660ba9b7bf83e21a9fb9bdcb10318e152ab988
http://cgit.freedesktop.org/libreoffice/core/commit/?id=a2685c5fd47396589e0767c5926a5bdb9f7b3390
http://cgit.freedesktop.org/libreoffice/core/commit/?id=ee3315bb22282d8725bef07c5fe2789e215309af
http://cgit.freedesktop.org/libreoffice/core/commit/?id=ac32bcac33e3326149fe700b2de4d22542d6c82a
http://cgit.freedesktop.org/libreoffice/core/commit/?id=cfec56f89f295002b2b2b9f68cd8f62dcca7c59c
http://cgit.freedesktop.org/libreoffice/core/commit/?id=51a5998433641aa62c4ce94af0be11d3c6e81852
Comment 2 Eike Rathke 2012-01-21 16:43:38 UTC
Anyone interested in details may want to have a look at http://erack.org/blog/archives/8-LibreOffice-date-acceptance-patterns.html