Fix start and end times when editing a broadcast message on firefox
What does this MR do and why?
- Firefox does not handle creating a
Dateobject from a string fomatted with-(dashes) as seen in #397678 in this function- Chrome is more forgiving and is not an issue there.
- converting with a
.to_son the dates produces2023-02-21 17:06:16 UTCformat, whereas the object itself has this formatTue, 21 Feb 2023 17:06:16.000000000 UTC +00:00
- The
dateStringformat should conform to the ISO 8601 format (YYYY-MM-DDTHH:mm:ss.sssZ)listed in https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date. If not, as stated on that page:the parsing behavior with other formats is implementation-defined and may not work across all browserswhich is likely what we were observing with the2023-02-21 17:06:16 UTCthat was being passed before with firefox.- So while this looks to be fixed with using
.iso8601format to ensure compliance and also match other places for broadcast message
- So while this looks to be fixed with using
similar fix in !112595 (merged)
Screenshots or screen recordings
| browser | before | after |
|---|---|---|
| firefox | ![]() |
![]() |
| chrome | ![]() |
no change |
How to set up and validate locally
- In Chrome
- Go to broadcast messages on your local gdk:
http://gdk.test:3000/admin/broadcast_messages - Create a broadcast message with start and end times.
- Notice it listed on
http://gdk.test:3000/admin/broadcast_messages - Go to edit it and notice the start and end time filled out.
- In Firefox:
- Go to broadcast messages
http://gdk.test:3000/admin/broadcast_messages - Go to edit the one that was created and notice the start and end time filled out.
- Notice the difference between master and this branch on display of start and end times on the edit of broadcast message
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #397678
Edited by Doug Stull


