Skip to content

refactor(control-plane): replace moment with the Temporal API#5177

Open
slavab89 wants to merge 2 commits into
github-aws-runners:mainfrom
slavab89:slava-b/replace-moment-with-temporal
Open

refactor(control-plane): replace moment with the Temporal API#5177
slavab89 wants to merge 2 commits into
github-aws-runners:mainfrom
slavab89:slava-b/replace-moment-with-temporal

Conversation

@slavab89

Copy link
Copy Markdown

Description

Replaces the maintenance-mode moment / moment-timezone packages with temporal-polyfill - a TC39 Stage 4 implementation that ships natively in Node 26.
Dropping the polyfill later will be a one-line change.

Key changes:

  • Temporal.Instant.compare() replaces relational comparisons on moment objects
  • inPeriodnow.until(next).total('seconds') + Math.trunc replaces moment.diff()

Test Plan

  • Updated unit tests to use temporal-polyfill fixtures.

Related Issues

Closes #3435

slavab89 and others added 2 commits June 15, 2026 20:45
Drops the maintenance-mode moment / moment-timezone packages and adds
temporal-polyfill ^0.3.2 (TC39 Stage 4; native in Node 26, polyfill until
the Lambda runtime upgrades).

Refs: github-aws-runners#3435
Co-authored-by: GitHub Copilot <copilot@github.com>
Rewrites bootTimeExceeded, runnerMinimumTimeExceeded, and inPeriod to
use Temporal.Instant. Test fixtures adopt a minutesAgo() helper.
Temporal.Instant.compare() replaces all relational comparisons on moment
objects; Number.isFinite() guard preserves false-on-unset-env-var behavior.

Refs: github-aws-runners#3435
Co-authored-by: GitHub Copilot <copilot@github.com>
@slavab89 slavab89 requested a review from a team as a code owner June 15, 2026 20:13
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.

Momentjs is in maintenace mode

1 participant