Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

time zones :) #499

Open
ahokcool opened this issue Feb 29, 2024 · 12 comments
Open

time zones :) #499

ahokcool opened this issue Feb 29, 2024 · 12 comments

Comments

@ahokcool
Copy link

Oye Oye,

I'm trying to promote the critical maps app in Lisbon along the riders. Therefore I added the tours on criticalmass.in.
Unfortunately Lisbon has the time zone GMT and not like most of the rest of europe GMT+1. So the tours are always shown 1 hour to early.

Could it be a quick fix to check, based on the coordinates of the event in which time zone it is to adjust the time slot the event is shown on the map?

All the best,
Alex

@mltbnz
Copy link
Member

mltbnz commented Feb 29, 2024

It's great to hear you are promoting the feature 👍

When I built the feature I honestly didn't take into account international usage. I quickly had to check how the backend is returning the dateTime and it doesn't provide a timezone unfortunately.

image

Bit since I know its will always be in Berlin timezone I think it should be fairly easy to convert it.

I would imagine basing it on the coordinates is tricky

@ahokcool
Copy link
Author

Thx :)

and fair enough - I guessed that time zones are not supported in criticalmass.in ;)

I also encountered a problem when creating the city of Lisbon. So at the moment it is listed in the region "Niedersachsen" :D But I don't think it matters too much.

Untitled

Regarding the time zones:
Maybe there is some easy, free API that converts coordinates into a time zone:
I did a quick search and found this one:
geoapify

Seems to be free up to 3.000 requests per day:
https://www.geoapify.com/pricing

Anyhow, thx for giving it a try :)

@mltbnz
Copy link
Member

mltbnz commented Feb 29, 2024

😄
There is an api from Apple that could be used but I think the device timezone should be ok

@mltbnz
Copy link
Member

mltbnz commented Mar 1, 2024

@ahokcool
Could you look at this please and check if my testing setup really works 😆
So basically the UNIX timestamp 1711731600 should be displayed correctly for the GMT timezone
#500

@ahokcool
Copy link
Author

ahokcool commented Mar 1, 2024

I'm always confused with the direction of time shifting :D

That's how I see it now:

image

@mltbnz
Copy link
Member

mltbnz commented Mar 1, 2024

yes. that should be ok, right?
I am also confused by it 😆

Screenshot 2024-03-01 at 14 40 45

@ahokcool
Copy link
Author

ahokcool commented Mar 1, 2024

Complicated :D No I don't think it's right yet :D

So on criticalmass.in I set the time to lets say 8pm.
I mean 8pm (Lisbon Time) but criticalmass.in thinks 8pm (Berlin Time)

image

So in the app, it actually doen't need to change it should also display 8pm (not 7pm) 🤔
So maybe for the displaying text nothing needs to be changed at all.

The only thing I realized is, that the event wasn't visible anymore up from like 1 hour before it started. I guess because of the one hour difference the app assumed that the event was already in the past...
But not sure if I got that right now :D

@mltbnz
Copy link
Member

mltbnz commented Mar 2, 2024

So wouldn't the simplest solution be to set the event to german time like 21 Uhr which would be the correct starting point in local lisbon time, right? Since 20 uhr lisbon time is 21 uhr german time.

I need to wrap my head around the api I guess to check if they really send a utc timestamp. Will take a look next week

@mltbnz
Copy link
Member

mltbnz commented Mar 4, 2024

I updated the PR.

Think it needs to be fixed to german timezone to make it work.

But I see others adding international events taking the timezone difference into account.

Not sure yet about what's best

@mltbnz
Copy link
Member

mltbnz commented Mar 6, 2024

Fyi. I merge the pr with fixed Germany Timezone since I think it's not obvious on the criticalmass.in website that times are implicitly in german timezone.

Will roll it out next month 🤞

@ahokcool
Copy link
Author

ahokcool commented Mar 6, 2024

Sorry for the late response I was quite busy...

I am not quite sure if I got it correctly but I guess you will make it work ;)

For me, the ideal situation would be to enter the event on criticalmass.in in the local time zone. So critical maps should display the upcoming event, correct since it just takes the date from the website. (I guess this is the state it used to be before I open this issue)
The only thing that should be changed is that the app should take into account that the time period in which the upcoming event will be promoted/displayed in the app should be according to the local aka device time zone.

Example:

  • Event in Lisbon at 8 PM Lisbon time.
  • I set up the event on critical mass.in for 8 PM (which will result in 8 PM Berlin time what I as a user don't really notice)
  • Critical maps will display the upcoming event for 8 PM (without mentioning a time zone)
  • The event should be visible in the app, maybe even up until half an hour after the official start: 8:30 PM Lisbon time (which should be 9:30 Berlin time)

@mltbnz
Copy link
Member

mltbnz commented Mar 8, 2024

Thanks.
So with the change I made it should be displaying the time you entered at criticalmass.in regardless of the timezone you are in.

I need to check if the logic to display an event needs some adjusting as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants