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 #1506

Closed
wants to merge 1 commit into from

Conversation

sevtdy
Copy link

@sevtdy sevtdy commented May 27, 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"

clone form #1493
related: #1493 #1503

@sevtdy sevtdy closed this May 27, 2021
@sevtdy sevtdy reopened this May 27, 2021
@sevtdy sevtdy closed this May 27, 2021
@sevtdy sevtdy reopened this May 27, 2021
@iamkun
Copy link
Owner

iamkun commented May 28, 2021

that is weird 🤔

@aloisklink
Copy link
Contributor

What might help @sevtdy is viewing https://travis-ci.com/github/iamkun/dayjs/requests.

It looks like both your earlier PRs had the error code: GitHub payload is missing a merge commit (mergeable_state: "clean", merged: false) and this current one has the error: Abuse detected.

"Abuse Detected" error

I am guessing you have made too many PRs recently, so Travis CI has blocked you: you might need to log into Travis CI with your GitHub account first (or contact support) for Travis to unblock you unfortunately (see https://travis-ci.community/t/some-pr-are-not-analyzed-with-message-abuse-detected/1191).

"GitHub payload is missing a merge commit" error

It's very weird: I believe Travis CI is looking for the field: "mergable": true and "merge_commit_sha": "...",, but your PR has both of them if you look at GitHub API:

alois@me:~$ curl -H "Accept: application/vnd.github.v3+json" https://github.com/gitapi/repos/iamkun/dayjs/pulls/1506
{
  "url": "https://github.com/gitapi/repos/iamkun/dayjs/pulls/1506",
  // ...
  "merge_commit_sha": "f1b4783ec02005944caa1db83ff05f433d1f482a",
  // ...
  "merged": false,
  "mergeable": true,
  // ...
}

Not sure what is up with this error? Maybe GitHub API was just slow a few days ago, and you just need to retry?

I had the same issue with #1448 but luckily just closing and re-opening the PR worked for me.

@sevtdy sevtdy closed this May 29, 2021
@sevtdy sevtdy reopened this May 29, 2021
@sevtdy sevtdy closed this May 29, 2021
@sevtdy sevtdy reopened this May 29, 2021
@sevtdy
Copy link
Author

sevtdy commented Jun 28, 2021

thank you for the tips, I try to push a new commit then it triggers Travis normally
don't know what caused this yet, but it finally works. 😂
@aloisklink

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.

3 participants