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

Invalid date error when manipulating dates with timezone plugin on Firefox and Safari #1444

Open
sylvaindubus opened this issue Apr 8, 2021 · 0 comments

Comments

@sylvaindubus
Copy link

Describe the bug
I'm getting an Invalid date error when I try to manipulate timezoned dates on Firefox and Safari. It works as expected on Chrome. I am using startOf, but it seems that other manipulative methods are giving invalid dates as well.

Expected behavior
I'm expecting a valid date on all browsers.

Information

  • Day.js 10.0.4
  • Browsers: Chrome 89 (😎), Firefox 87 (🙁), Safari 14 (🙁)

Minimum code to reproduce it:

import dayjs from "dayjs";
import utc from "dayjs/plugin/utc";
import timezone from "dayjs/plugin/timezone";

dayjs.extend(utc);
dayjs.extend(timezone);

const date = dayjs().tz("America/New_York").startOf("month");

console.log(date.format());
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

1 participant