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

[no-issue]: Move datetime to tsutils #4266

Merged
merged 1 commit into from
Nov 24, 2022
Merged

[no-issue]: Move datetime to tsutils #4266

merged 1 commit into from
Nov 24, 2022

Conversation

kael89
Copy link
Collaborator

@kael89 kael89 commented Nov 18, 2022

Just moving the utils in datetime.js to @tupaia/tsutils

I left a copy of utcMoment in @tupaia/utils because it's currently used in many places. Will move that later on

Copy link
Member

@edmofro edmofro left a comment

Choose a reason for hiding this comment

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

lgtm! Thanks @kael89, perfect bite sized PR 😁

.names()
.find(name => getUtcOffsetFromTimestamp(timestamp) === momentTimezone.tz(name).format('Z'));

export const utcMoment = (...args: Parameters<typeof moment['utc']>) => moment.utc(...args);
Copy link
Member

Choose a reason for hiding this comment

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

This is an interesting one, a bit magic but I see what it's doing and it's really useful :-)

@kael89
Copy link
Collaborator Author

kael89 commented Nov 22, 2022

@edmofro I believe this can be merged now?

@edmofro edmofro merged commit 1c176d2 into dev Nov 24, 2022
@edmofro edmofro deleted the move-datetime-to-tsutils branch November 24, 2022 02:10
@edmofro
Copy link
Member

edmofro commented Nov 24, 2022

It surely can!

@edmofro edmofro mentioned this pull request Nov 24, 2022
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.

2 participants