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

Fix timezones usage in time utils

    XMLWordPrintable

    Details

    • Affected Branches:
      MOODLE_39_STABLE

      Description

      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).

        Attachments

          Activity

            People

            Assignee:
            noeldemartin Noel De Martin
            Reporter:
            noeldemartin Noel De Martin
            Participants:
            Component watchers:
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: