Skip to content

fix(date): preserve seconds and sub-minute anchored ranges in humanizeDateRange - #9

Open
kruschdev wants to merge 1 commit into
pascalorg:mainfrom
kruschdev:fix/humanize-date-range-seconds
Open

kruschdev wants to merge 1 commit into
pascalorg:mainfrom
kruschdev:fix/humanize-date-range-seconds

Conversation

@kruschdev

Copy link
Copy Markdown

Description

Fixes a two-way round-trip gap in humanizeDateRange (plan 030, plan 007) where second-grain endpoints and sub-minute anchored ranges lost their seconds on humanize.

  • formatClock previously rendered only HH:MM, turning 9:00:30am to 5:00:45pm into "9:00 AM to 5:00 PM" and 2026-07-03T09:00:30 to 2026-07-03T17:00:45 into "2026-07-03 9:00 AM to 2026-07-03 5:00 PM", which re-parsed at minute grain with truncated seconds. I updated formatClock to render :SS whenever an endpoint carries second grain or a non-zero getSeconds().
  • anchoredPhrase previously operated in whole minutes (m = diff / 6e4), dropping anchor seconds on "10 minutes starting 2026-07-03T09:00:30" and returning null on sub-minute anchored durations like "30 seconds starting 2026-07-03T09:00:15", which then fell through to bare "9:00 AM to 9:00 AM" without its calendar date or seconds. I updated anchoredPhrase to compute exact civil seconds so second-unit durations and second-grain anchors round-trip cleanly ("30 seconds starting 2026-07-03 9:00:15 AM"), and ensured non-integer anchored fallbacks keep their calendar date.

Checklist

Gates

  • bun run check green (typecheck, tests, build, size budgets, corpus gate, zero-deps gate)
  • bun run lint green (Biome via Ultracite)
  • Corpus diff is ADDITIVE (zero changes to existing corpus contracts)

API surface

  • Semver impact: patch (bug fix restoring documented two-way round-trip invariant on humanizeDateRange)

Knowledge layer

  • CHANGELOG updated under [Unreleased]
  • Removed resolved item from plans/backlog.md

@vercel

vercel Bot commented Nov 22, 2026

Copy link
Copy Markdown

@kruschdev is attempting to deploy a commit to the Pascal Team on Vercel.

A member of the Team first needs to authorize it.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant