andstatus / todoagenda

Android home screen widgets showing future (and past) calendar events and tasks
Apache License 2.0
130 stars 19 forks source link

Widget is stuck in another timezone after travelling #106

Open gbakeman opened 2 years ago

gbakeman commented 2 years ago

Using Todo Agenda 4.5.6 OnePlus 6T, Android 9

I rarely travel, but after returning home from a trip, the agenda widget is stuck in the timezone of my trip destination, causing all events to show in that timezone. I've been home for nearly 24 hours and the timezone remains in the old zone. If I look at the Other settings menu for the widget, under Lock time zone, it says Unlocked, current zone: [Old timezone]. My device acquires the current timezone automatically from the network it's connected to, and it changed almost instantly when I returned.

yvolk commented 2 years ago

Please look deeper at any concrete event that is opened clicking on it in the widget. That event should have time and time zone... Maybe time zone in that event is wrong?!

gbakeman commented 2 years ago

I will admit that creating events in a different timezone was rather confusing, but no, the widget settings clearly stated the entire widget was set to a different timezone. The only workaround I've found was deleting and recreating the widget.

yvolk commented 2 years ago

Our widget allows to export events and settings for debugging, so please next time create it for investigation.

rassie commented 2 years ago

Having the same problem, what can I do to help debug?

yvolk commented 2 years ago

Hi @rassie Please see my advices above.

rassie commented 2 years ago

@yvolk I just checked the widget again, it seems to have reverted to the right timezone after two days. Can't create debugging info now, sorry. Will do next time!

sphh commented 1 year ago

I have the same problem: If the time zone gets automatically changed (because the phone logs into a mobile network in a different time zone), the times in the agenda list does not get updated. It takes some time for the agenda list to display the new times. If I edit an appointment, the agenda list gets updated immediately.

I have not tried the Update button in the header but that might help. Still it would be nice, if the times gets updated automatically …

arucard21 commented 1 year ago

I just had a similar problem after changing time zones. The update button also didn't work, nor did removing and re-adding the widget. But what did work, was to go to the App Info in the settings (long press the widget usually shows a shortcut for this) and "force stop" the app. Next time I clicked on the widget, it updated to the correct date and time zone.

Hope this helps others that have these problems. Though a restart of your device would probably achieve the same result.

yvolk commented 11 months ago

As I figured out, the problem was caused by usage of org.joda.time.DateTimeZone#getDefault that has this note: "If the java.util.TimeZone default is updated after calling this method, then the change will not be picked up here" This explains, why app (or device) restart was needed to pick up the changed Time zone.

I fixed the issue, will be included in the next release

gbakeman commented 11 months ago

Excellent work, thank you!

yvolk commented 10 months ago

I released this fix in v.4.8.0, please see https://github.com/andstatus/todoagenda/releases/tag/4.8.0-release