Skip to content

Replace moment.js with Temporal API (temporal-polyfill)#7488

Draft
Copilot wants to merge 2 commits into
masterfrom
copilot/add-temporal-polyfill-and-integrate
Draft

Replace moment.js with Temporal API (temporal-polyfill)#7488
Copilot wants to merge 2 commits into
masterfrom
copilot/add-temporal-polyfill-and-integrate

Conversation

Copilot AI commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

Removes moment and moment-timezone in favor of the TC39 Temporal API via temporal-polyfill.

New utility layer

source/lib/temporal.ts — central module providing moment-compatible helpers over Temporal.ZonedDateTime:

  • format(dt, token) — supports moment-style tokens (h:mma, MMM Do, LT, dddd, Do, etc.)
  • Comparison helpers: isBefore, isAfter, isSame, isSameOrBefore, isSameOrAfter, isBetween
  • Parsing: parseDate, parseDateFormat, parseTimeToday, parseTimeComponents
  • Relative time: fromNow, relativeTo (Math.ceil rounding), calendar
  • Conversion: toDate, fromDate, fromEpochMs, fromTimestamp

Migrations

  • modules/: timer (useMomentTimeruseTemporalTimer, deprecated alias kept), event-type, ccc-calendar, event-list, food-menu, datepicker, add-to-device-calendar
  • source/views/: building-hours, transportation/bus, streaming, menus, sis, student-orgs, stoprint
  • scripts/validate-bus-schedules.mjs: moment replaced with pure-JS time parsing
  • Test helpers: moment.helper.tstemporal.helper.ts in building-hours and bus test suites

Cleanup

  • Removed source/init/moment.ts and its app.tsx import
  • moment, moment-timezone removed from dependencies
  • CLAUDE.md updated to reference Temporal

Tests

All 200 tests pass (36 suites), TypeScript clean.

Copilot AI and others added 2 commits April 13, 2026 10:58
@hawkrives

Copy link
Copy Markdown
Member

Our test coverage isn't good enough for me to trust this one. Also not thinking I like the moment compatibility layer.

Leaving as draft…

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants