formkit/tempo
 Watch   
 Star   
 Fork   
20 hours ago
tempo

v1.6.0

✨ New

  • formatDuration(duration, { locale?, style?, smallest? }): "1 hour, 5 minutes", "1 hr, 5 min", "1h 5m" or "1:05:00", built on Intl.DurationFormat with a fallback for older runtimes. Pass milliseconds or { hours: 1, minutes: 5 }. Zero formats as "0 seconds". (#62, #109)

🐞 Fixes

  • parse month names now match the in-context (genitive) forms many languages use in dates, so format → parse round-trips in ru, pl, uk, cs, sk, fi, lt, hr, zh, ko and more. Matching is case/whitespace-lenient like other literals ("JANUARY 6, 2024"). Thanks @jayhemnani9910! (#92)

⚠️ Behavior change

  • parse now throws for an unknown month name (e.g. "Foo 6, 2024"). Previously it silently used the current month, which produced wrong dates. Wrap parse in try/catch if you accept free-form input. (@formkit/pro's datepicker already handles this since 0.134.1.)
1 days ago
tempo

v1.5.0

New helpers, timezone fixes and a big thank-you to @bardrop 🙌

✨ New

  • relative(date, { base?, locale?, numeric?, style?, unit? }): "5 minutes ago", "yesterday", "in 3 weeks", "dans 3 ans". A thin layer over Intl.RelativeTimeFormat that picks the unit for you. Hours use the wall clock, days count calendar dates (so DST and skipped midnights don't shift them), and months/years are completed units like diffMonths/diffYears. Amounts are truncated toward zero; zero keeps its direction ("0 seconds ago"). (#7, #108)
  • weekNumber(date?, startOfWeekDay = 1, firstWeekContainsDate = 4): week of the year, ISO 8601 by default (2024-12-30 → 1). weekNumber(d, 0, 1) gives US-style Sunday weeks. (#44, #105)
  • isBefore(null, date) / isAfter(null, date) type-check ("is now before…?"), matching isEqual. (#56, #107)

🐞 Fixes

  • tzDate uses the target zone's offset at the target time, so wall times around DST changes convert correctly (e.g. local timestamps around Berlin's switch). (#96 by @bardrop, fixes #74)
  • format(…, "Z") without tz prints the offset of the actual instant. For the first hours after each DST change it printed the previous offset (03:30 -05:00 instead of -04:00 in New York), and historical second-precision offsets lost their seconds (Detroit 1904 -05:32:11), so format → parse round-trips were off by 11s. (#67, #106)
  • diffMonths / diffYears: on a clamped month-end anniversary (Jan 31 → Feb 28) the time of day is now respected. Jan 31 23:00 → Feb 28 01:00 is 0 months (was 1). (#108)

⚠️ Behavior changes

  • The diffMonths/diffYears month-end fix above changes results only in that exact case (374 of 200,000 random pairs).
  • format device offsets now differ from 1.4.0 only where 1.4.0 was wrong (checked against Intl every ~4h from 1990–2030 in 5 zones).
2 days ago
tempo

v1.4.0

A batch of community fixes 🙌 — thank you @jayhemnani9910, @pcbeingused333, @imsurya26!

⚠️ Behavior changes

  • diffDays / diffWeeks count calendar days across DST (#93): diffDays("2026-03-15", "2026-03-01") is now 14 in DST zones (was 13). Days are counted on the device's wall clock, like addDay and diffMonths, so two instants exactly 14×24h apart across a fall-back now count 13 days. diff() follows suit. diffHours stays elapsed time.
  • diffMonths respects time of day (#104): 2024-03-15T09:00 vs 2024-02-15T10:00 is 0 months (a few hours short), was 1. Date-only inputs are unchanged. Flows into diffYears and diff().

Fixes

  • nearestDay with month/week/year constraints no longer returns a day from the previous period (#91)
  • dayOfYear counts calendar days across skipped dates (e.g. Pacific/Apia 2011) (#97)
  • hourStart/hourEnd/minuteStart/minuteEnd stay in the same occurrence of a repeated (fall-back) hour (#102)
  • diffWeeks(date) / diffWeeks(null, date) type-check, comparing with now (#101)
5 days ago
tempo

v1.3.0

   🚀 Features

7 days ago
tempo

v1.2.0

   🐞 Bug Fixes

7 days ago
tempo

v1.1.2

   🐞 Bug Fixes

17 days ago
tempo

v1.1.1

   🚀 Features

  • Add Braid site attribution link to footer  -  by @andrew-boyd (0eddc)

   🐞 Bug Fixes

2026-05-09 04:17:17
tempo

v1.1.0

   🚀 Features

  • Replace Kickstart callout with FormKit for React announcement  -  by @andrew-boyd (46db3)

   🐞 Bug Fixes

  • Inline DocSearch CSS for production build compatibility  -  by @justin-schroeder (f89f8)
  • Offset() returns NaN for dates with non 4-digit years  -  by @tk1024 (4e944)
  • Prevent mixed-sign diff durations  -  by @justin-schroeder (bd478)
2025-12-23 01:37:48
tempo

v1.0.0

   🚀 Features

   🐞 Bug Fixes

  • Update pnpm-lock.yaml to lockfileVersion 9.0  -  by @andrew-boyd (b91c1)
  • Update pnpm-lock.yaml to lockfileVersion 9.0  -  by @justin-schroeder (a6502)
  • Support seconds precision in timezone offsets  -  by @justin-schroeder in https://github.com/formkit/tempo/issues/67 (c1d55)
  • Improve search modal performance and styling  -  by @justin-schroeder (1e285)
  • Add packageManager field for pnpm version  -  by @justin-schroeder (184e7)
  • Flaky test and Vercel build compatibility  -  by @justin-schroeder (848da)
2024-06-27 04:55:53
tempo

v0.1.2

   🐞 Bug Fixes