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

Gives Invalid Date on Safari browser #1011

Closed
hiravesonali opened this issue Aug 18, 2020 · 4 comments
Closed

Gives Invalid Date on Safari browser #1011

hiravesonali opened this issue Aug 18, 2020 · 4 comments

Comments

@hiravesonali
Copy link

Describe the bug

I have this date string 2020-07-16 11:27:38.000000 from server.

When I parse it to dayjs, it works fine in Chrome and Firefox but giving Invalid Date error in Safari.

I have tried out with different formats(see below) but none of them works in safari.

var serverDate = '2020-07-16 11:27:38.000000'

console.log(dayjs(serverDate, 'YYYY-MM-DD hh:mm:ss.SS').format('MMM Do, YYYY')) // => "Invalid Date"

console.log(dayjs(serverDate, 'YYYY-MM-DD hh:mm:ss.SSS').format('MMM Do, YYYY')) // => "Invalid Date"

console.log(dayjs(serverDate, 'YYYY-MM-DD hh:mm:ss.SSSSSS').format('MMM Do, YYYY')) // => "Invalid Date"

The codepen link for my case is here.

Expected behavior
Should parse the given string in Safari as well.

Information

  • Day.js Version ^1.8.28
  • OS: MacOs Mojave(10.14 )
  • Browser - Safari Version 12.0
@iamkun
Copy link
Owner

iamkun commented Aug 19, 2020

This fix #1010 might also fix this bug I think.

@hiravesonali
Copy link
Author

@iamkun Thanks for the update. I think the fix you mentioned will solve my problem. When are you planning to make a next release?

@iamkun
Copy link
Owner

iamkun commented Aug 20, 2020

released @hiravesonali

@hiravesonali
Copy link
Author

Yes, it is working perfect. Thank you 🙌

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

No branches or pull requests

2 participants