{{ message }}
feat: support L (last day of month)#396
Merged
Merged
Conversation
Implements the feature requested in node-cron#147, originally proposed by @antonidasyang in node-cron#396, rebuilt on the current TypeScript codebase. `L` (or lowercase `l`) in the day-of-month field matches the last calendar day of each month (28-31, leap-aware), on its own (`0 0 12 L * *`) or combined with explicit days (`0 0 12 15,L * *`). The token is preserved through the pattern pipeline and resolved against the real date in both match() and getNextMatch. Validation accepts `L` only in the day-of-month field and rejects variants such as `LW`.
L (last day of month)
merencia
added a commit
that referenced
this pull request
Jun 17, 2026
Reflects the day-of-month `L` support added in #396.
merencia
added a commit
that referenced
this pull request
Jun 17, 2026
Reflects the day-of-month `L` support added in #396.
Merged
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.

Closes #147
Adds support for
L(last day of the month) in the day-of-month field, the feature originally proposed here by @antonidasyang. The original commits targeted the v3 JavaScript codebase, which has since been rewritten in TypeScript; this branch reimplements the same feature cleanly on the current code (full credit to @antonidasyang for the proposal and the original PR).Behavior
0 0 12 L * *runs at 12:00 on the last calendar day of every month (28/29/30/31, leap-year aware).lis accepted too.0 0 12 15,L * *runs on the 15th and the last day.Lis valid only in the day-of-month field; variants likeLWandLin other fields are rejected by validation.Implementation
Las a literal token instead of coercing it toNaN.day-of-monthhelper resolves the last day and the match, shared by bothTimeMatcher.matchand theMatcherWalker(sogetNextMatchlands on the right day).Lin the day-of-month field only.Tests
day-of-monthunit tests (last-day resolution + matching, including leap years and15,L).TimeMatchermatch +getNextMatchcases (Jan 31, Feb 28, leap Feb 29, roll-over).L/l/15,L, rejectedLWandLoutside day-of-month).Full suite green (280 tests), build and lint pass.