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

Incorrect value set to Events.EVENT_TIMEZONE (Android) #182

Closed
kinex opened this issue Mar 11, 2020 · 2 comments
Closed

Incorrect value set to Events.EVENT_TIMEZONE (Android) #182

kinex opened this issue Mar 11, 2020 · 2 comments

Comments

@kinex
Copy link

kinex commented Mar 11, 2020

I have been investigating some timezone related issues and found this in the plugin code:
https://github.com/builttoroam/flutter_plugins/blob/develop/device_calendar/android/src/main/kotlin/com/builttoroam/devicecalendar/CalendarDelegate.kt#L390

I am quite sure displayName is not the correct value to put there, you should use ID instead (as told e.g. here).

So why does it seem to work then without issues? I think this is because the value (DateTime.millisecondsSinceEpoch) passed from Dart is UTC time. Setting invalid value to EVENT_TIMEZONE is probably ignored and actual timezone is reverted to UTC.

So I think it is also a bug even trying to put the current device timezone to EVENT_TIMEZONE, because the Event.start is UTC.

Fix options:

  1. Save in EVENT_TIMEZONE the UTC timezone.
  2. Convert Event start/end to local time and save in EVENT_TIMEZONE the device timezone.
  3. Remove setting EVENT_TIMEZONE at all? Maybe the default is UTC? Should be tested.

Or have I misunderstood something?

@bhl09
Copy link
Contributor

bhl09 commented Mar 11, 2020

I haven't seen any issue with using displayName except it uses wrong (or null) timezone when you use your local calendar in Samsung phones. Just tried out with using id and it seems to be working.
Thanks for the point and I'll put this in so it's available in the next release.

@bhl09
Copy link
Contributor

bhl09 commented Mar 25, 2020

All TimeZone variables are now using id in v3.1.0, closing this ticket.

@bhl09 bhl09 closed this as completed Mar 25, 2020
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