Open peterjanes opened 2 years ago
You need to use forwardDate: true
@Slapbox That will force the date to move into the next year, which is exactly what I don't want.
forwardDate
(boolean) to assume the results should happen after the reference date (forward into the future)
Ah I see I misunderstood the issue - apologies.
We're having a related but opposite undesired behavior: dates that are more than 6 months in the future are rolled back into the previous year. Like @peterjanes, I would expect the year to be set to the current year if unspecified.
chrono.parseDate('December 31', new Date('2024-06-01'))
Sun Dec 31 2023 12:00:00 GMT-0600 (Central Standard Time)
Using forwardDate
doesn't work for this either, because then relative dates like “last Friday” get interpreted as future dates (which seems pretty wonky; I would expect the parser to give up rather than interpret “last Friday” as a date in the future).
I'd expect that parsing a day with no year would imply using the year of the reference date, but if the reference is more than 6 months after the relative date then the year is advanced.