-
-
Notifications
You must be signed in to change notification settings - Fork 8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid date recognition #1646
Comments
Just so we're on the same page: the root problem is the incredible flexibility of the Date constructor in V8 and other JS engines. In chrome, There are a handful of workarounds for common cases we've seen but it's not pretty. The "right" answer is to skip the date constructor entirely and just regex against a series of culture-specific formats |
I understand the inherent problem with solving such issue - there always will be some edge cases. Working around this particular one seems to be trivial - simply expect the month name to be a whole word, surrounded with non-alphabetic characters, if we assume (which might not be true) that the string is a ECMA-262 Date.toString() representation. |
Hi, I had a similar issue with "SEPEM GRENOBLE 2018" text which is transformed in 9/1/18 date. |
Moving the discussion to #1300 @krojew The spec uses the phrase "implementation-dependent":
That Date Time String Format is related to ISO 8601 and does not cover the set of date expressions understood by Excel |
fuzzydate() function incorrectly guesses date due to invalid regex pattern. For example, let's look at "Trollahaugen 64" text. First, it tries to convert it to date and it ends up being 01.01.1964 due to 64 at the end. Then it proceeds with looking for a month using /jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec/ regex. This is the source of error, since the text contains "aug" inside but it's not a separate word, hence should not be considered a month. Yet, the function assumes it is and returns 01.01.1964.
The text was updated successfully, but these errors were encountered: