Repository navigation
Replace moment with built-in Intl date formatting - #69
Merged
Merged
Conversation
The CLI used moment for table dates, the access key expiry date and debug log timestamps. date-utils reproduces moment 2.31.0's English output exactly, including its relative-time cutoffs, its daylight saving aware day count, and "Invalid date" for missing or invalid times. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Exact moment wording is not part of the CLI's contract, so the built-in
Intl formatters replace the date-utils helper. Relative times use exact
numbers ("50 minutes ago", "yesterday"), the expiry date reads "… at 2:05 PM"
and debug timestamps use a 24-hour clock. A missing date shows as an empty
cell instead of crashing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ashirman
approved these changes
Oct 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of REV-135 (dependency cleanup, step 4). Removes
moment, which took 5.4 MB innode_modules, mostly 139 locale files the CLI never loads, and which its maintainers call a legacy project.The CLI doesn't promise an exact date wording, so this uses Node's built-in
Intlformatters rather than copying moment's rules. Dates are worded slightly differently; see the table below.Changes
access-key ls,session ls,deployment ls,deployment history):formatDateincommand-executor.tsusesIntl.RelativeTimeFormatwithin 30 days andtoLocaleDateStringfor older dates.access-key patchexpiry date:toLocaleStringwithdateStyle: "full"andtimeStyle: "short".debuglog timestamps:toLocaleTimeStringwith a 24-hour clock.en-US, so output stays English on any machine.momentis removed fromdependencies. The two tests that check the expiry message now expect "at".Output before and after
access-key patchexpirydebugtimestampsVerification
tsc,npm run lintandnpm run format:checkare clean.🤖 Generated with Claude Code