Uploaded image for project: 'Moodle app'
  1. Moodle app
  2. MOBILE-3784

Fix timezones usage in time utils

XMLWordPrintable

    • Hide

      This issue only needs to be tested in 1 device.

      1. Install the app in a device using a timezone different than GMT+0.
      2. Login in any site and go to More > Calendar.
      3. Click to create a calendar event. Check that the time set in "Date" is the current time of the device.
      Show
      This issue only needs to be tested in 1 device. Install the app in a device using a timezone different than GMT+0. Login in any site and go to More > Calendar. Click to create a calendar event. Check that the time set in "Date" is the current time of the device.
    • MOODLE_400_STABLE
    • MOODLE_401_STABLE
    • Moodle App 4.1.0

      There is a couple of time utils that are not working properly with dates.

      For example, the method toDatetimeFormat returns a user date in the local timezone with a "Z" appended at the end. That is not correct because "Z" means UTC+0, so any user outside of this timezone would be generating an incorrect date string.

      As far as I could tell, this is not a problem for users at the moment because conversely the convertToTimestamp method incorrectly substracts the local timezone offset of the current user (whereas date strings ending in Z are already using UTC+0).

      This may cause more issues down the line, and right now this required a fix adding display-timezone="utc" in ion-datetime components in order to avoid users seeing an incorrect date. Once this problem is fixed, ion-datetime should be reverted to using the default timezone (which is the user's locale).

        1. photo_2022-11-18_10-25-35.jpg
          37 kB
          Rodrigo Mady
        2. photo_2022-11-18_10-25-30.jpg
          22 kB
          Rodrigo Mady

            dpalou Dani Palou
            noeldemartin Noel De Martin
            Noel De Martin Noel De Martin
            Isabel Renedo Rouco Isabel Renedo Rouco
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.