feat(en): support end-of-period expressions - #654
Open
martinfrancois wants to merge 2 commits into
Open
Conversation
Support 'end of' and 'last day of' for named and current months, including leap years and closest-year inference. Fixes wanasit#521.
martinfrancois
force-pushed
the
fix/issue-521-end-of-period
branch
from
August 1, 2026 14:40
2b36a65 to
380da48
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds casual English support for
end of …andlast day of …expressions. The parser now resolves the complete expression to the final calendar day of a current, named, or relative period.Closes #521
Supported Expressions
The new behavior covers:
end of the monthandlast day of month.end of Julyandlast day of July.end of next week,end of next month, andend of next year.end of February 2024,end of October next year, andend of october 2032.this,last,past, andnextmodifiers for relative weeks, months, and years.The complete expression is included in the parse result, with correct handling for 30- and 31-day months, leap years, and closest-year inference when a named month has no explicit year.
Implementation
ENEndOfCurrentMonthParserfor current-month expressions.ENEndOfRelativePeriodParserfor relative week, month, and year expressions.ENEndOfMonthRefinerfor named months and relative-year suffixes.How to Verify
last day of July,end of the month,end of next week,end of next month,end of next year,end of October next year, andend of october 2032with the default English parser.npm run test:silent -- --runInBandandnpm run build.Test Plan
Risk Assessment
Low — the behavior is limited to the casual English configuration and requires an explicit
end oforlast day ofexpression.