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

date.formatDate wrong result #8039

Closed
pikax opened this issue Nov 13, 2020 · 2 comments
Closed

date.formatDate wrong result #8039

pikax opened this issue Nov 13, 2020 · 2 comments

Comments

@pikax
Copy link

pikax commented Nov 13, 2020

Describe the bug
format date to DD/MM/YYYY when the initial date is 1234-12-12 (YYYY-MM-DD), gives the result of 11/12/1234 instead of 12/12/1234

Codepen/jsFiddle/Codesandbox (required)
https://codesandbox.io/s/serene-williams-84uc3?file=/src/App.vue

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://codesandbox.io/s/serene-williams-84uc3?file=/src/App.vue
  2. Click on 'Click me'
  3. See the output

Expected behavior
Output is expected to 12/12/1234

Screenshots

image

Platform (please complete the following information):
OS: CBS
Browsers: Chrome

Additional context

@pdanpdan
Copy link
Collaborator

Hello.

Do not use dates in dash separated formats - they'll be interpreted in your local (client/browser) timezone, so you might end up in the prev/next day.
See here:

@pikax
Copy link
Author

pikax commented Nov 13, 2020

Hello, makes sense, but can that be added to the docs, because the dash separated formats shows in the docs.

image
https://quasar.dev/quasar-utils/date-utils

A gotcha or warn would be great.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants