Fix Broadcast messages not showing in admin console
What does this MR do and why?
- Firefox does not handle creating a
Dateobject from a string fomatted with-(dashes) as seen in #388926 (closed) 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 removal of
.to_swe'll use.iso8601format to ensure compliance and also match other places for broadcast message
- So while this looks to be fixed with removal of
Screenshots or screen recordings
| browser | before | after |
|---|---|---|
| firefox | ![]() |
![]() |
| safari | same issue as 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.
- Notice it listed on
http://gdk.test:3000/admin/broadcast_messages - In Firefox:
- Go to broadcast messages
http://gdk.test:3000/admin/broadcast_messages - Notice the difference between master and this branch on display of broadcast messages
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 #388926 (closed)
Edited by Doug Stull



