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: incorrect startOf/endOf behavior with +00:00 timezone #1493

Closed
wants to merge 1 commit into from

Conversation

sevtdy
Copy link

@sevtdy sevtdy commented May 10, 2021

assume I'm in +08:00, when I parse time string with any regions in +00:00(like UTC, Africa/Abidjan), got the incorrect result

example:
incorrect in dayjs:

dayjs.tz('2021-04-01', 'Asia/Hong_Kong').endOf('day').format()
// "2021-04-01T23:59:59+08:00"
dayjs.tz('2021-04-01', 'Africa/Abidjan').endOf('day').format()
// "2021-04-01T15:59:59Z"
dayjs.tz('2021-04-01', 'UTC').endOf('day').format()
// "2021-04-01T15:59:59Z"

expect work like moment

moment.tz('2021-04-01', 'Asia/Hong_Kong').endOf('day').format()
// "2021-04-01T23:59:59+08:00"
moment.tz('2021-04-01', 'Africa/Abidjan').endOf('day').format()
// "2021-04-01T23:59:59Z"
moment.tz('2021-04-01', 'UTC').endOf('day').format()
// "2021-04-01T23:59:59Z"

@iamkun
Copy link
Owner

iamkun commented May 26, 2021

i'll reopen this pr to trigger a CI test

@iamkun iamkun closed this May 26, 2021
@iamkun iamkun reopened this May 26, 2021
@sevtdy sevtdy changed the base branch from dev to master May 26, 2021 09:39
@sevtdy sevtdy changed the base branch from master to dev May 26, 2021 09:39
@sevtdy sevtdy closed this May 27, 2021
@sevtdy sevtdy reopened this May 27, 2021
@iamkun
Copy link
Owner

iamkun commented May 27, 2021

Can you close this and re-open a new PR, please?

There might be some problem with Github CI trigger

@sevtdy
Copy link
Author

sevtdy commented May 27, 2021

sure.

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