Fix on-call edit form formatting issue
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:
- Create a rotation that with
00:00
as the start time. - Edit the rotation. Observe the start time.
- Create a rotation that with
Screenshots (strongly suggested)
before | after |
---|---|
Does this MR meet the acceptance criteria?
Conformity
-
📋 Does this MR need a changelog?-
I have included a changelog entry. -
I have not included a changelog entry because this MR is behind a feature flag.
-
- [n/a] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides - [n/a] Database guides
- [n/a] Separation of EE specific content
Availability and Testing
- [n/a] Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process.
-
Tested in all supported browsers - [n/a] Informed Infrastructure department of a default or new setting change, if applicable per definition of done
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