Faith Forge LabsWebsites and software · Israel

Decide what happens when the target month has no matching day

“Review this in six months” leaves an important question unanswered when the starting date is near the end of a month. Software can carry an unavailable day into the following month, stop at the target month's last day or reject the calculation. The correct choice comes from the organisation's approved rule.

This fictional example concerns a software supplier's internal review of published product information. It is not a legal retention period, a contractual renewal or a Faith Forge Labs service deadline. The investigation keeps the publishing date, review policy and staff assignment separate.

Start with the owner's rule

The supplier approves policy R6: review a published comparison six Gregorian calendar months after its release date; if that target month lacks the original day, use the target month's last day. The period is calculated from the release date, not from when someone opens the review queue.

Comparison C-18 was released on 31 August 2026. Six calendar months later is February 2027. February has no day 31, so R6 requires a review date of 28 February 2027.

The policy is recorded before the implementation is examined. Without it, a developer could produce a technically consistent date while choosing an unapproved business rule.

Locate the unexpected March date

The staff queue displays 3 March 2027. The source release date is still 31 August, and the record is attached to R6. A trace of the date helper shows that it sets the month six positions forward while retaining day 31. The date operation normalises the unavailable February day into March.

A reduced JavaScript fixture starting at 2026-08-31T00:00:00Z and calling setUTCMonth() with six added months produces 2027-03-03T00:00:00.000Z. UTC is used here to isolate the arithmetic demonstration; the business record remains a date, not a midnight appointment.

MDN's setUTCMonth documentation describes the retained day and out-of-range adjustment. The function is behaving according to its date rules. The application selected an operation whose result does not satisfy R6.

Correct the calculation without changing the policy

The selected implementation calculates the target year and month, determines that month's available days and applies the explicit R6 constraint. It retains the original release date and policy identifier beside the derived review date.

Date libraries offer different operations and overflow options. For example, Temporal.PlainDate.add documents constrain and reject behavior. A project must verify its actual supported runtime and chosen operation; naming a library does not establish that the approved policy has been implemented.

A fixed number of days is not substituted for the six-month rule. Nor is a constant number of milliseconds added. Those alternatives would answer different questions from the one the owner approved.

Verify the boundary and ordinary cases

The fictional acceptance record compares these fixtures:

Release date R6 review date Purpose
31 August 2026 28 February 2027 Target month lacks day 31
27 August 2026 27 February 2027 Ordinary day remains unchanged
31 August 2027 29 February 2028 Leap-year February uses its actual last day
15 October 2026 15 April 2027 Ordinary month and year transition

C-18 now displays 28 February in both the review queue and its record detail. Reopening the record produces the same result. The release date remains 31 August 2026, and the comparison's published content is untouched. The ordinary-day control does not get moved to month end merely because another record required a constraint.

An item without an approved policy is held for an owner decision. The helper does not silently apply R6 to every date in the system.

Arrange the work separately

A correct date still does not identify a person who will do the review. In the fictional team's calendar, the manager agrees with reviewer R-12 to complete C-18's review on 26 February 2027, ahead of the policy date. That assignment is recorded and acknowledged through the team's normal process.

The policy date stays 28 February. It is not overwritten with the earlier work date. The example makes no assumption about ordinary working days, religious observance or holiday coverage in Israel or elsewhere; the manager has made a specific staffing decision for this task.

If a timed remote meeting is needed, its date, time and named time zone belong in a separate appointment. Turning the date-only review rule into a universal midnight UTC deadline would introduce a meaning the owner did not approve.

Leave the next review decision visible

Completing the review may lead to approval, correction or withdrawal of the comparison. The date calculation does not choose that outcome or certify that the product information is accurate. Those decisions remain with the responsible product and language reviewers.

The handover includes R6, the four fixtures, the actual implementation choice and the distinction between policy date and assigned work date. If the owner later changes the review interval or month-end convention, that change needs its own effective scope and acceptance checks.

Use the working plan to identify who approves the rule and who accepts the implementation. The internal tools service can include the queue, ownership and evidence needed to make the review happen without hiding the underlying decision.