tabi-memo / backend

0 stars 0 forks source link

Change Trip Data Schema #18

Closed kanatagu closed 9 months ago

kanatagu commented 10 months ago

What I Changed

Why I changed

Reference Slack: https://tabimemoworkspace.slack.com/archives/C063AKD40PL/p1706395513822929

Example

  1. A use created trip date as date_from: "2024-01-01T00:00:00+09:00" and send the date to Database. This is Tokyo timezone.
  2. When a user want to see the schedule in Vancouver, the data from the database is like this date_from: "2023-12-31T15:00:00+00:00"
  3. However, in client side JS change to the date object using Tokyo time zone so it will be exact same input data like: date_from: "2024-01-01T00:00:00+09:00"
  4. If a use want to modify, again Tokyo timezone will be set to send to database
  5. Activity time is same logic
Screenshot 2024-01-28 at 6 03 53 PM

Note

Yo-mah-Ya commented 9 months ago

In this app, I have set the timezone for all dates and times as 'Asia/Tokyo' so that every time the time is converted into a JS Date object from the database, it will be consistent.

How come all dates and times have become suddenly recognized as Asia/Tokyo ?

kanatagu commented 9 months ago

In this app, I have set the timezone for all dates and times as 'Asia/Tokyo' so that every time the time is converted into a JS Date object from the database, it will be consistent.

How come all dates and times have become suddenly recognized as Asia/Tokyo ?

@Yo-mah-Ya Anywhere is fine but we need Absolute timezone. I just chose Asia/Tokyo because we're Japanese...

Yo-mah-Ya commented 9 months ago

Anywhere is fine but we need Absolute timezone.

I didn't get the meaning of absolute timezone in this context though, if you mean that you wanna take advantage of the lack of daylight savings time in Japan, - which I guessed it comes from Slack threads - it's not granted it wouldn't change down the load.

But for now, I just wanna review this in inductive way, so if it works, approve !👍