Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

QR code time for event moved 2 hours forward #2761

Closed
MikeMcC399 opened this issue Apr 7, 2021 · 4 comments
Closed

QR code time for event moved 2 hours forward #2761

MikeMcC399 opened this issue Apr 7, 2021 · 4 comments
Assignees
Labels
bug Something isn't working mirrored-to-jira This item is also tracked internally in JIRA

Comments

@MikeMcC399
Copy link
Contributor

MikeMcC399 commented Apr 7, 2021

Technical details

  • Device name: Google Pixel 3a emulator
  • Android version: 11
  • App version: v2.0.0-RC2

Describe the bug

The time defined when creating a QR code for an event is displayed as 2 hours later when the event is saved.

Steps to reproduce the issue

  1. Open CWA, scroll down to "CREATE QR CODE" and select it
  2. Tap on "+ QR CODE"
  3. Tap on "Cultural event"
  4. Enter a description text and a place text
  5. Define start and end times and make a note of them
  6. Tap "SAVE"
  7. Examine the screen with the header "My QR Codes" and note that the times are two hours later than the ones entered in step 5.

Create QR code

Saved event

Expected behavior

The times entered should be the same as the times later displayed after a QR code for an event is created.

Possible Fix

It looks like there may be a confusion between UTC and local times. The local time zone is currently CEST which is UTC+2.


Internal Tracking ID: EXPOSUREAPP-6249

@MikeMcC399 MikeMcC399 added the bug Something isn't working label Apr 7, 2021
@d4rken
Copy link
Member

d4rken commented Apr 7, 2021

Nice catch. I agree, it's an issue with UTC conversion.

We should either adjust for the users local time within the ViewModel, or change the picker to use users current timezone already on the generated choices, and then convert them to UTC before storing them.
Later one seems cleaner, expect the UI to be in the users timezone, and then convert to UTC before saving.

/cc @jurajkusnier

Screenshot from 2021-04-07 18-03-46

.setSelection(defaultValue?.toDateTime(DateTimeZone.UTC)?.millis)
.apply {
if (minConstraint != null) {
setCalendarConstraints(
CalendarConstraints.Builder()
.setValidator(
DateValidatorPointForward
.from(minConstraint.withMillisOfDay(0).toDateTime(DateTimeZone.UTC).millis)
)
.build()
)
}
}

@dsarkar dsarkar added the mirrored-to-jira This item is also tracked internally in JIRA label Apr 7, 2021
@dsarkar
Copy link
Member

dsarkar commented Apr 7, 2021

Internal Tracking ID: EXPOSUREAPP-6249

@codejus
Copy link

codejus commented Apr 9, 2021

Bugfix for this issue is #2786.

@MikeMcC399
Copy link
Contributor Author

This issue has been fixed through the merged PR #2786 in branch release/2.0.x.

Since this was a development version and had not yet been released through the Google Play Store this issue can now be closed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working mirrored-to-jira This item is also tracked internally in JIRA
Projects
None yet
Development

No branches or pull requests

4 participants