NUDelta / interactive-soap-notes

Supporting coaching for complex work within and outside of coaching interactions
0 stars 0 forks source link

timezones don't persist through changes #69

Open kapil1garg opened 1 month ago

kapil1garg commented 1 month ago

I set the timezone in UTC originally, but the front-end is generating timezones in America/Chicago. what's ultimately happening is that the timezone info is getting stripped out of the Dates as they are passed around, so the server misinterprets the timestamp as being in UTC time (which is 5/6 hours ahead) when it should be Chicago time

one way to fix this is to have EVERYTHING use only UTC, and include a timezone property as part of the CAPNotes. then, only when creating a formatting string, do you convert to timezones.

kapil1garg commented 1 month ago

using something like date-fns with utc would make life easier: https://github.com/date-fns/utc?tab=readme-ov-file

good read: https://moment.github.io/luxon/#/zones?id=dst-weirdness

kapil1garg commented 1 month ago

Gonna leave this open for now incase something was missed