WickyNilliams / cally

Small, feature-rich calendar components
https://wicky.nillia.ms/cally/
MIT License
1.06k stars 12 forks source link

First day of the Month Issue #44

Closed wilcolinadev closed 1 month ago

wilcolinadev commented 1 month ago

Hey there!

Just happened to notice on one of my projects that, the start of the week is not matching as expected, I thought it probably was a configuration issue on my site, however, I noticed the same problem in the official documentation example.

For example, June, 1st 2024 should be a Saturday while the Calendar is displaying that day as a Sunday.

Let me know if it could just be something related to my time, or if it might be an issue with the utils or even better just an issue on my end.

Thank you for taking a look!

Reference Screenshots below

Screenshot 2024-05-22 at 8 43 06 PM Screenshot 2024-05-22 at 8 43 21 PM

WickyNilliams commented 1 month ago

Oh that's weird. Seems related to #18

Did you change anything in the above screenshot to show Tuesday as first day of the week? Seems like an off by one error somehow.

May I ask what timezone you are in?

wilcolinadev commented 1 month ago

No, I did not change anything in the screenshots. It seems to be fine just now, but I have already seen it happen twice during the past two evenings, which is definitely making me think that it could be a timezone issue.

I am located in Central Daylight Time GMT-5

WickyNilliams commented 1 month ago

Thanks for the info. Yeah must be related to timezone. Can you give some info on browser (+ version) and OS please?

wilcolinadev commented 1 month ago

You got it,

Chrome Version for the Browser Version 125.0.6422.76 (Official Build) (arm64) Mac OS Sonoma

The issue was also consistent across iPads and IPhone, with the latest OS versions using chrome

WickyNilliams commented 1 month ago

I noticed there were some places I wasn't using getUTC*/setUTC* methods on Date. I have fixed those up now, and released as 0.6.1.

I'm hoping that fixes things for you. Can you check (around the same time you observed the bug?) and report back please. You might want to clear you browser cache to be sure you're getting the latest version from the docs

wilcolinadev commented 1 month ago

Hey, thanks a lot for checking on that, I will keep an eye on it today, and if I see something weird I will let you know.

WickyNilliams commented 1 month ago

Appreciate it! I'll reopen this issue for now pending your feedback

wilcolinadev commented 1 month ago

I looked it up over the past two days and I did not see the bug, so it looks like that was the issue, thanks a lot for looking into it so quickly, take care!

WickyNilliams commented 1 month ago

Great! Glad to hear. Hopefully that's the last of the bugs related to this. It really is an uphill battle to prevent JS printing dates in user's timezone