Closed pzmarzly closed 5 years ago
@pzmarzly I am unable to reproduce this in the svelte.dev repl even when I set my system date to the one you provided and enable this extension. I may need more details. I don't see anything in particular in this function which would break given a change to the timezone but maybe I'm missing something.
@pzmarzly I am not seeing this error in chrome (Windows), with the extension (https://chrome.google.com/webstore/detail/change-timezone-time-shif/nbofeaabhknfdcpoddmfckpokmncimpj?hl=en) installed and active. Do you have more specific steps needed to reproduce the issue you're seeing?
I dug for a bit, and found out that there is a problem with Date.getMonth()
when using that extension (it e.g. still reports September on 2019-10-01 00:00, unlike the JS API). This is definitely extension's bug, not svelte-calendar
's. It looks like it could be worked around by changing these lines:
- let date = new Date(year, month, 1);
+ let date = new Date(year, month, 1, 15);
- let date = new Date(start.getFullYear(), start.getMonth(), 1);
+ let date = new Date(start.getFullYear(), start.getMonth(), 1, 15);
, but I don't suggest we do that - I'm leaving this just for future reference.
Looking at that extension's review page, I can see svelte-calendar
is not the only calendar affected:
after a few days of use: breaks a number of sites, including flight booking at westjet.com (calendars do not work at all) and managing my Mikrotik router (all dates are incorrect by a day.)
I'll try contacting the extension's author. Anyway, the issue can be closed.
Do you have more specific steps needed to reproduce the issue you're seeing?
Sadly, not really. The bug also happens on my Ubuntu VM with clear Firefox (aside of that extension), English (US) locale. I tried setting different timezones, it made no difference.
With this extension enabled, I keep getting this error, both in Firefox, and Chrome, no matter which timezone I choose:
Current real date on my PC is 2019-10-19 19:41, Saturday.
Smallest reproducible example code:
I don't think any of my users will have this extension installed, but this behaviour shouldn't happen nonetheless.