Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(i18n): formatIsoDate handles trailing 0s #1821

Merged
merged 1 commit into from
Nov 27, 2024

Conversation

andrewwylde
Copy link
Contributor

This pull request includes changes to improve the date formatting in the i18n module. The most important changes include adding new test cases for various ISO date formats and modifying the formatIsoDate function to exclude milliseconds.

This resolves a bug where a timestamp with trailing 0s will result in dividing the number by 1000 twice, resulting in an incorrect date.


Improvements to date formatting:

  • packages/core/i18n/src/i18n.spec.ts: Added test cases to ensure formatIsoDate correctly formats ISO dates with and without milliseconds, and with different time zone offsets.

Codebase simplification:

@andrewwylde andrewwylde added the create preview package Trigger the CI to release a PR package preview version label Nov 27, 2024
@andrewwylde andrewwylde enabled auto-merge (squash) November 27, 2024 20:20
Copy link
Contributor

@kaiarrowood kaiarrowood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🚀

@andrewwylde andrewwylde merged commit 58af65d into main Nov 27, 2024
31 of 35 checks passed
@andrewwylde andrewwylde deleted the fix/timestamps-trailing-0s branch November 27, 2024 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
create preview package Trigger the CI to release a PR package preview version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants