Skip to content

Fix on-call edit form formatting issue

Tristan Read requested to merge tr-chrome-schedule-date-fix into master

What does this MR do?

There is an issue in the on-call scheduling edit form where a time of 00:00 is interpreted as 24:00 instead. This occurs in Chrome and Edge.

This MR fixes it by using a more specific format option.

Background info

Browsers differ in their implementation of the hour12 option in the Intl.DateTimeFormat formatter. Chromium based browsers use h24 which allows the hours digit to be 24 in some cases. Firefox uses h23.

There is a more specific option we can use - hourCycle. With this we can specify h23 which limits the hour to 23. This matches what we use in the edit form.

issue: #324711 (closed)

Testing

  • Feature flag is :oncall_schedules_mvc.
  • A GitLab Premium license and above is required.
  • The issue occurs on Chrome (and I'm assuming Edge also)
  • To trigger:
    1. Create a rotation that with 00:00 as the start time.
    2. Edit the rotation. Observe the start time.

Screenshots (strongly suggested)

before after
Screenshot_2021-03-16_at_11.56.50 Screenshot_2021-03-16_at_11.56.27

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • [n/a] Label as security and @ mention @gitlab-com/gl-security/appsec
  • [n/a] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • [n/a] Security reports checked/validated by a reviewer from the AppSec team
Edited by Tristan Read

Merge request reports

Loading