You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The parser fails to correctly process date strings prefixed with "in" and followed by the short name of months (e.g., "in Jun"). While the recognition strips the "in" and identifies the month (e.g., "Jun"), the resulting text does not retain "in", causing the standalone month not to be recognized as a date when parsed separately.
Environment
Version: "chrono-node": "^2.7.5"
Steps to Reproduce
Configure a new chrono instance with default settings:
Expected result: Date recognition for "jun".
Actual result: No date is returned.
Expected Behavior
The parser should retain the "in" prefix in the recognized text because its removal results in the standalone month not being recognized as a date. Ideally, both "in Jun" and "Jun" should be correctly parsed as dates with the context retained when necessary.
Actual Behavior
The parser outputs "Jun" instead of "in Jun" when parsing "in Jun", and subsequently fails to recognize "Jun" as a valid date in the absence of the "in" prefix.
Proposed Fix
Retain the "in" prefix when needed to subsequently recognize the text.
The text was updated successfully, but these errors were encountered:
The parser should retain the "in" prefix in the recognized text because its removal results in the standalone month not being recognized as a date.
We do not have a precise definition what make up of the result text (and its index location).
What has been the case so far is: text makes up phases the date/time are parsed/extracted from. It does not have to include other "clue" or "context" phases to explain why we think the text is date/time.
In your example, the word "in" (from "in jun") is only a clue. It is not part of the date/time.
Ideally, both "in Jun" and "Jun" should be correctly parsed as dates with the context retained when necessary
I don't think I agree with that assumption.
Unless you know what is the input domain/context, "Jun" or "jun" is not always "June". (If anything, I am also not sure if "in jun" should be recognized as June either).
--
Could you share the use-cases where this current behavior is inconvenient for you?
The parser fails to correctly process date strings prefixed with "in" and followed by the short name of months (e.g., "in Jun"). While the recognition strips the "in" and identifies the month (e.g., "Jun"), the resulting text does not retain "in", causing the standalone month not to be recognized as a date when parsed separately.
Environment
"chrono-node": "^2.7.5"
Steps to Reproduce
Configure a new chrono instance with default settings:
Parse the string "in Jun" with the following settings:
Expected result:
result[0].text
should be "in jun".Actual result:
result[0].text
is "jun".Repeat the parsing without the "in" prefix:
Expected result: Date recognition for "jun".
Actual result: No date is returned.
Expected Behavior
The parser should retain the "in" prefix in the recognized text because its removal results in the standalone month not being recognized as a date. Ideally, both "in Jun" and "Jun" should be correctly parsed as dates with the context retained when necessary.
Actual Behavior
The parser outputs "Jun" instead of "in Jun" when parsing "in Jun", and subsequently fails to recognize "Jun" as a valid date in the absence of the "in" prefix.
Proposed Fix
Retain the "in" prefix when needed to subsequently recognize the text.
The text was updated successfully, but these errors were encountered: