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

front: drop formatToIsoDate() #10845

Merged
merged 4 commits into from
Mar 6, 2025
Merged

front: drop formatToIsoDate() #10845

merged 4 commits into from
Mar 6, 2025

Conversation

emersion
Copy link
Member

@emersion emersion commented Feb 18, 2025

See individual commits.

This function was a bit weird, because it had two unrelated purposes: format a human-readable string with a fixed frenchy format, or format a machine-readable string for API purposes. The function also accepted strings and numbers as input (implicitly converting these to dates), making it so callers are less type-safe.

@github-actions github-actions bot added the area:front Work on Standard OSRD Interface modules label Feb 18, 2025
@emersion emersion self-assigned this Feb 18, 2025
@emersion emersion force-pushed the emr/drop-iso-date-helpers branch from 3c7252a to 4d58dc6 Compare February 20, 2025 13:21
@emersion emersion mentioned this pull request Feb 20, 2025
22 tasks
@emersion emersion force-pushed the emr/drop-iso-date-helpers branch from 4d58dc6 to 475e86b Compare March 3, 2025 15:47
@emersion emersion changed the title front: drop isoDateToMs() and formatToIsoDate() front: drop formatToIsoDate() Mar 4, 2025
emersion added 4 commits March 4, 2025 10:05
This is simpler and safer.

No behavior change.

Signed-off-by: Simon Ser <contact@emersion.fr>
No need to use a custom function to convert to an ISO string, the
Date API already has this covered.

Signed-off-by: Simon Ser <contact@emersion.fr>
The format doesn't matter too much here. toLocaleString() is better
localized.

Signed-off-by: Simon Ser <contact@emersion.fr>
This is now unused.

This function was a bit weird, because it had two unrelated
purposes: format a human-readable string with a fixed frenchy
format, or format a machine-readable string for API purposes.
The function also accepted strings and numbers as input
(implicitly converting these to dates), making it so callers are
less type-safe.

Signed-off-by: Simon Ser <contact@emersion.fr>
@emersion emersion force-pushed the emr/drop-iso-date-helpers branch from 475e86b to d0d6b8d Compare March 4, 2025 10:10
@emersion emersion requested review from Synar and SharglutDev March 4, 2025 10:12
@emersion emersion marked this pull request as ready for review March 4, 2025 10:19
@emersion emersion requested a review from a team as a code owner March 4, 2025 10:19
Copy link
Contributor

@SharglutDev SharglutDev left a comment

Choose a reason for hiding this comment

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

Lgtm and tested

@emersion emersion added this pull request to the merge queue Mar 6, 2025
Merged via the queue into dev with commit 8590f5e Mar 6, 2025
27 checks passed
@emersion emersion deleted the emr/drop-iso-date-helpers branch March 6, 2025 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:front Work on Standard OSRD Interface modules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants