kartevonmorgen / kartevonmorgen.ts

Mapping-Frontend to find and add sustainable Organisations (Initiatives, Companies) and Events on Kartevonmorgen.org / MapofTomorrow.org
https://kartevonmorgen.org/
GNU General Public License v3.0
11 stars 13 forks source link

[BUG] Time on map is wrong for imported events #164

Closed wellemut closed 1 year ago

wellemut commented 1 year ago

Describe the bug All Events on the new frontent are shown two hours ahead of time.

If you add an event on https://www.kartevonmorgen.org the problem is less visible because the frontend shows the time, as you have entered it. But if you import event vial ICal or you see events from old frontend, you see this error!

To Reproduce Steps to reproduce the behavior:

  1. Add an Event on the old frontend https://v0.kartevonmorgen.org (or import it via Ical Wordpress Plugin)
  2. Compare what you see on v0. versus kartevonmorgen.org
  3. If you have imported the event from another source, you clearly see the difference...

Expected behavior No matter where I add an event to the map, it should be shown in the correct timezone (currently its summer time in Europe)

navid-kalaei commented 1 year ago

@wellemut the old front end does not show the time in the client's local time. it shows the in the GMK time zone. you can validate via https://www.unixtimestamp.com/. however the new front end displays the time in the clients time zone.

TL;DR: the old front end does not respect timezones

wellemut commented 1 year ago

@navid-kalaei is still dont trust your moment.js, although you think that their Timezone translation works fine.

Because we can export all events in caldav format. Here you finde all events from Emmendingen: http://openfairdb.org/api/v0/export/events.ical?bbox=48.02116128565783,7.498855590820313,48.249826274326274,8.171768188476564

And when I open this Ical feed in my calendar, it shows the correct times, like the imported feed: grafik

So the time in list view: grafik and map: grafik is wrong.

Also the imported Event in Wordpress is shown in the correct timezone: https://klimafitemmendingen.de/veranstaltungen/ grafik

navid-kalaei commented 1 year ago

the exporter and word press do not respect the timezone. they simply assume all times are UTC.

To validate that I should see a different time because I live in Iran and have a different time zone, right? But the time shown to me is the same as yours.

You can also pick a time from exported times and test that with https://www.unixtimestamp.com/ . Just see what time it will show for your local time.

Screenshot from 2023-05-01 13-20-22

wellemut commented 1 year ago

@sjoerdtakken could it be, that the iCal export from WP to ofDB of your plugin does not respect the timezone of the event?

wellemut commented 1 year ago

@navid-kalaei you are right. Also the csv export http://openfairdb.org/api/v0/export/events.csv?bbox=48,7.5,48.25,8.17&end_min=1682978400 has the UNIX Timestamp of 7pm grafik and when i use https://www.unixtimestamp.com/ to transfer it, it shows 9pm (which is technically correctly converted from backend to frontend but wrong for the enduser) grafik

Its also technically correct for events, which I enter manually by the new frontend: https://www.kartevonmorgen.org/m/main/ev/58a5f604661a433cae6a46a171e2315c?c=48.1974%2C7.6668&z=13.00&type=event grafik grafik

the entry csv shows the timestamp of 7:15 UTC grafik which is 9:15 in MESZ grafik

So it is definitly a Bug happening while import! @sjoerdtakken

Also th

sjoerdtakken commented 1 year ago

I see it happens with all the events in the KVM. From the Wordpress Plugin I always the local Time (timezone is then Europe/Berlin) to the KVM. I now see I should transfer the UTC time to the OFDB. Okay I will change that, that makes sense. First I do I simple Fix and later I have to think about configuration possiblilities for different Timezones.

wellemut commented 1 year ago

**Sjoerd Takken, [Fr, 05.05.23 17:23] Ich habe jetzt ein Quick und Dirty Fix gemacht, die Funktioniert jetzt und steht für Download bereit. https://github.com/kartevonmorgen/wp-kvm-syndication-toolbox/archive/refs/heads/main.zip

Sjoerd Takken, [Fr, 05.05.23 17:31] Man muss dann aber bei Wordpress dafür sorgen das alle Events einmal geändert worden, damit die nach der KVM hochgeladen werden.

Sjoerd Takken, [Fr, 05.05.23 17:31] ich habe der Status einfach einmal auf Entwurf und dann wieder auf Veröffenlichten gemacht.**

sjoerdtakken commented 1 year ago

Now I also produced a better Solution which can be downloaded here: https://wordpressvonmorgen.lindenhofpi.selfhost.co/

or take the attached files wp-kvm-syndication-toolbox.zip wp-kvm-syndication-toolbox-log.txt

There is also the possibility to set the default Time Zone under the Settings of the KVM Syndication Toolbox. Then go to Events Interface and there is a Dropdown with different timezones in Europe. Default is always Europe/Berlin.

For now I hope this should be a workable Solution.

Good luck

wellemut commented 1 year ago

Update veröffentlicht: https://t.me/Kartevonmorgen/530

sjoerdtakken commented 1 year ago

There where still some problems with Feed import and timezones. I Fixed them Today, downloads are here

wp-kvm-syndication-toolbox.zip wp-kvm-syndication-toolbox-log.txt

I also removed the setting for the Timezone in the Events Interface, because I found out there is a setting in Wordpress. So I use now this Setting in the plugin