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

Library fails for the basic case dateFormat("2022-11-10", "mmm dd") #182

Closed
justin-barca-at-camis opened this issue Apr 20, 2022 · 3 comments

Comments

@justin-barca-at-camis
Copy link

justin-barca-at-camis commented Apr 20, 2022

Even a datestring with no time or timezone info is rendered incorrectly, date is offset.

See: https://codesandbox.io/s/naughty-lederberg-8dri33?file=/src/index.js

In the console I see "Nov 09"

@pkuprys
Copy link

pkuprys commented Sep 13, 2023

most likely because of the UTC offset in the Date object, see https://stackoverflow.com/questions/28344408/why-does-js-subtract-a-day-from-a-date-object-with-a-certain-format

@chase-manning
Copy link
Collaborator

Even a datestring with no time or timezone info is rendered incorrectly, date is offset.

See: https://codesandbox.io/s/naughty-lederberg-8dri33?file=/src/index.js

In the console I see "Nov 09"

I think the first input should be a date not a string. Try put a date into it. dateFormat(new Date(), "mmm dd");

@chase-manning
Copy link
Collaborator

Closing due to inactivity.

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

3 participants