raae / pow-app

Take charge of your menstrual cycle with POW! — the privacy-first menstrual cycle journal
https://www.usepow.app/
GNU General Public License v3.0
33 stars 2 forks source link

Edit entry opens wrong date #250

Closed raae closed 3 years ago

raae commented 3 years ago

A user in the pacific timezone has reported trying to edit notes and then having them saved on the day before.

raae commented 3 years ago

I think this has something to with the entryId to date logic, will try to reproduce.

raae commented 3 years ago

Managed to reproduce by setting the timezone to Calefornia.

raae commented 3 years ago

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date

Support for ISO 8601 formats differs in that date-only strings (e.g. "1970-01-01") are treated as UTC, not local. (highlight mine)

raae commented 3 years ago

Fix by using parseISO from date-fns.