← Graph

Don't Auto-Convert Calendar Units

takeaway 2 connections

Most calendar libraries silently convert '31 January + 1 month' into 28 February, 1 March, 3 March, February 31, or an exception. All are legitimate depending on context (tax software vs Google Calendar vs scheduling last-Wednesday-unless-5th rules). The only winning move is not to play: libraries should expose durations, time points and calendars as separate abstractions, force explicit conversions, and let the programmer — who knows the domain — decide. Demonstrated by Chrono.

type
recommendation
takeaway Don't Auto-Convert Calendar Units
about
Chrono tool
Chrono's refusal to answer '31 January + 1 month' is the reference design.
takeaway Don't Auto-Convert Calendar Units
from_talk
Extracted from the Chrono walkthrough on '31 January + 1 month'.

Provenance