refactor(deprecation): replace moment with luxon#13207
Merged
Conversation
MounirDhahri
previously approved these changes
Jan 30, 2026
Member
Author
|
@MounirDhahri yessss but we need to carefully review this PR in case claude missed any spots haha |
Member
MounirDhahri
left a comment
There was a problem hiding this comment.
Here is the output of me asking Opus to review this
Issues to Address
- Test Behavior Change (AuctionResultListItem.tests.tsx:223-225)
- expect(navigate).not.toHaveBeenCalled()
- expect(navigate).toHaveBeenCalled()
This test assertion was inverted. The original test expected that when onPress is specified, navigate should NOT be called. The
new test expects the opposite. This appears unrelated to the moment→luxon migration and needs verification.
- Ordinal Date Format Loss (TimeSince.tsx:22)
- return date.format("ddd, MMM Do, h:mm A")
- return date.toFormat("EEE, MMM d, h:mm A")
Moment's Do produces ordinal numbers ("1st", "2nd", "3rd") while Luxon's d produces plain numbers ("1", "2", "3"). This changes
output from "Wed, Jan 1st, 3:30 PM" to "Wed, Jan 1, 3:30 PM". If ordinals are desired, you'll need a custom helper.
- Describe Block Mistakenly Converted to it (Timer.tests.tsx:170)
- describe("displays the minutes when the sale does not end on the hour", () => {
- it("displays the minutes when the sale does not end on the hour", () => {
A describe block was changed to an it block. This removes the grouping structure. If intentional, the block body should be
reviewed for nested tests.
- Potential Null Timezone (Timer.tsx:119)
const userZone = DateTime.local().zoneName
zoneName can return null in rare edge cases. Consider:
const userZone = DateTime.local().zoneName ?? "UTC"
Files Needing Extra Attention
- src/app/Components/Lists/tests/AuctionResultListItem.tests.tsx - behavior change
- src/app/Scenes/Inbox/Components/Conversations/TimeSince.tsx - ordinal format change
- src/app/Components/Bidding/Components/tests/Timer.tests.tsx - describe→it change
- src/app/utils/saleTime.ts - complex timezone logic, highest risk
Member
|
I reviewed Claude's output, and it seems to be valid in this case |
Member
Author
|
fixing the tests and will review afterwards |
🎉 Beta Versions Generated (commit:
|
MrSltun
previously approved these changes
Feb 11, 2026
Member
MrSltun
left a comment
There was a problem hiding this comment.
Thank you for this change, finally!!
I left a few comments, but other than that it looks great! 🌟
Comment on lines
+80
to
+82
| .toFormat("h:mma ZZZZ") | ||
| .replace("AM", "am") | ||
| .replace("PM", "pm") |
Member
There was a problem hiding this comment.
Suggestion: I see that this is being used in multiple places. Should we move it to a util file?
|
|
||
| describe("absolute date label", () => { | ||
| it("shows the start date if the sale has not started", () => { | ||
| it("shows the start date if the sale has not started", async () => { |
a639097 to
641f867
Compare
1dc8e67 to
8fb7641
Compare
🎉 Beta Versions Generated (commit:
|
Replace all moment.js and moment-timezone usage with Luxon equivalents: - Update test infrastructure to support Luxon timezone mocking - Migrate duration components to use Luxon Duration API - Convert complex timezone conversion logic in saleTime.ts - Update timer and countdown components - Migrate date formatting, comparisons, and arithmetic operations - Remove moment.js and moment-timezone dependencies Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
66c59eb to
66a0cfa
Compare
gkartalis
commented
Mar 11, 2026
| hours: duration.hours(), | ||
| minutes: duration.minutes(), | ||
| seconds: duration.seconds(), | ||
| days: duration.as("days"), |
Comment on lines
125
to
+268
| @@ -254,9 +259,13 @@ export const AuctionResult: React.FC<Props> = (props) => { | |||
| <Text variant="sm-display">{auctionResult.title}</Text> | |||
| <Text variant="xs" color="mono60" my={0.5}> | |||
| {[ | |||
| moment(auctionResult.saleDate).utc().format("MMM D, YYYY"), | |||
| auctionResult.saleDate | |||
| ? DateTime.fromISO(auctionResult.saleDate).toUTC().toFormat("MMM d, yyyy") | |||
| : "", | |||
| auctionResult.organization, | |||
| ].join(" • ")} | |||
| ] | |||
| .filter(Boolean) | |||
| .join(" • ")} | |||
Comment on lines
+23
to
+32
| DateTime.fromISO(endAt).diff(DateTime.fromISO(currentTime)).toISO() || "PT0S" | ||
| ) | ||
| const daysTilEnd = durationTilEnd.as("days") | ||
| const hoursTillEnd = durationTilEnd.as("hours") | ||
| const secondsTilEnd = durationTilEnd.as("seconds") | ||
|
|
||
| const hasStarted = | ||
| Duration.fromISO(DateTime.fromISO(startAt).diff(DateTime.fromISO(currentTime)).toString()) | ||
| .seconds < 0 | ||
| Duration.fromISO( | ||
| DateTime.fromISO(startAt).diff(DateTime.fromISO(currentTime)).toISO() || "PT0S" | ||
| ).seconds < 0 |
Contributor
gkartalis
added a commit
that referenced
this pull request
Mar 12, 2026
This reverts commit 6584717.
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.





This PR resolves []
Description
Completely removes moment and moment-timezone and replaces them with luxon.
Migration was performed along with Claude so please review carefully.
Followups:
PR Checklist
To the reviewers 👀
Changelog updates
Changelog updates
Cross-platform user-facing changes
iOS user-facing changes
Android user-facing changes
Dev changes
Need help with something? Have a look at our docs, or get in touch with us.