Repository navigation
Don't move explicit stub dates to the end of the month - #3031
Merged
lballabio merged 1 commit intoNov 13, 2026
Merged
Conversation
With endOfMonth set and an end-of-month seed, Schedule moved every inner date to the end of its month, including an explicit firstDate or nextToLastDate. A short final stub ending on November 15th ended on November 30th instead, and a first date on the last business day of February could be rolled into March by a Following convention. Explicit stub dates are now only adjusted by the business-day convention, as was already the case for the effective and termination dates.
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.
When
endOfMonthis set and the schedule is generated from an end-of-month seed,Schedulemoves every inner date to the end of its month. This includes an explicitfirstDateornextToLastDate, so the stub that was asked for is silently changed. For example,ends with July 31st, 2027, November 30th, 2027 and December 15th, 2027 instead of having the short final stub start on November 15th. Going backwards, a
firstDateof February 15th, 2026 becomes February 28th. With a business-day convention the date can even move to the next month: a first date of February 27th, 2026 (the last TARGET business day of the month) is moved to the 28th and then rolled to March 2nd byFollowing.The cause is the end-of-month pass at the end of the rule-based constructor, which applies
Date::endOfMonthto all inner dates. The explicit stub dates are now only adjusted by the business-day convention, as #1509 already does for the effective and termination dates; regular dates are still moved to the end of the month.The new test case
ScheduleTests/testStubDatesWithEomAdjustmentcovers the three cases above. It fails on master with the dates quoted here and passes with the change; the other schedule tests and the full test suite pass.