pnp / List-Formatting

List Formatting Samples for use in SharePoint and Microsoft Lists
https://pnp.github.io/List-Formatting/
MIT License
1.7k stars 822 forks source link

date-page-a-day-calendar displays day before in central time zone #787

Open jaxkookie opened 3 months ago

jaxkookie commented 3 months ago

I have used the date-page-a-day-calendar for some time and have not seen any issues. I had a user advise me that the date was displaying the day before, but I could not replicate this. When I remove the script date is correct in both time zones. On a whim I changed my timezone from Eastern to the users in Central. When I applied the script I was able to replicate the bug. The date reflects the day before. I do not see anything that stands out. The only places I found a "-1" in the code it was related to styling. Can anyone replicate this, or see a way to fix it?

thanks

tecchan1107 commented 3 months ago

Hi @jaxkookie .

I tried it in my environment and reproduced it. Also, I verified the behavior of the getDate operator and found that when I changed the time zone of my computer, the date retrieved with the getDate operator displayed a different value than the date displayed in the column.

image

I will create an issue on sp-dev-docs to ask about this phenomenon.

tecchan1107 commented 3 months ago

I created the issue! https://github.com/SharePoint/sp-dev-docs/issues/9618