Repository navigation
Version 4.0.0
Breaking changes
-
Breaking change:
{includeYear: false}now hides the year in every case.Previously, passing
falsewas not a reliable way to hide the year: it behaved the same astruefor the current year, and was silently ignored for past or future years. The option is now a symmetric counterpart to{includeYear: true}.The default behavior when the option is not present is unchanged: hide the year when it matches the current year, and show it otherwise.
Deprecations
-
Deprecated:
includeMinutesin favor ofincludeMinutesAtTopOfHour. Passing the old option emits aconsole.warn. The old option still works for now but will be removed in v5. Seedocs/options-v4-v5.mdfor the migration. -
Deprecated:
useDayNameForLastWeekin favor ofuseDayNameWithinWeek. Passing the old option emits aconsole.warn. The old option still works for now but will be removed in v5. Seedocs/options-v4-v5.mdfor the migration.
Added
-
Added
suppressAmPmoption togetAPTime. Drops the trailinga.m./p.m.suffix so callers can compose AP-style time ranges (e.g."7-8 p.m.").midnightandnoonliterals are unaffected. -
Added
includeMinutesAtTopOfHouroption togetAPTime. ReplacesincludeMinuteswith a name that reflects its actual scope — it only affects top-of-hour rendering — and fixes thefalse-acts-like-truebug in the old option. -
Added
useDayNameWithinWeekoption togetAPDate. Renders the weekday name for dates within a week of today in either direction, matching AP style.
What's Changed
Compare: v3.1.0...v4.0.0
- 🤖 Bump vitest from 4.1.3 to 4.1.4 by @dependabot[bot] in #536
- 🤖 Bump prettier from 3.8.1 to 3.8.2 by @dependabot[bot] in #535
- [Breaking Change] Fix
includeYearto honorfalseby @banterability in #537 - Add
useDayNameWithinWeekoption togetAPDateby @banterability in #538 - Deprecate useDayNameForLastWeek by @banterability in #539
- Add
includeMinutesAtTopOfHouroption togetAPTimeby @banterability in #540 - Deprecate
includeMinutesby @banterability in #541 - Add
suppressAmPmby @banterability in #542