ericgio / weekday-golf

A codified history of our bi-weekly-ish games.
1 stars 2 forks source link

Store dates without timezones #21

Closed makinde closed 3 years ago

makinde commented 3 years ago

AFAICT, the dates stored for rounds are meant to represent a date, not a specific time. Well, I guess they are the time we started, but that info is only stored as a date on the site. If the plan is to only keep/show the date, I think it's best practice to store that as a string '2020-10-11'. This allows one to not worry about timezone and store something that more closely represents the intended purpose.

ericgio commented 3 years ago

FWIW, the time is intentionally included in the spreadsheet, even though it's not currently surfaced in the app. Not sure I quite understand the argument/reasoning mentioned. I don't see much downside to including the time. Everything is currently America/Los_Angeles anyway, so if we did want to display time, it'd be easy enough to get it right. If we ever implement #13 we could add timezone to that data.

makinde commented 3 years ago

No problem with it being in the spreadsheet. It just seemed odd to me that We read in the full date (with time) from the spreadsheet, attach a hard coded timezone, then use the moment library to parse out the time, with timezone...all just to display the date portion. Simply extracting just the date component from the spreadsheet would have the desire effect without brining in a large library or having to think about timezones at all. "Store" was probably the wrong word choice. I meant "don't parse out the time if we aren't using it". Diff coming.

ericgio commented 3 years ago

I'm seeing all the round dates as off by a day now.

makinde commented 3 years ago

Yup, most def the culprit. Will fix tomorrow

makinde commented 3 years ago

Fixed again in #34