I am having a date in the format 2022-01-27 09:23:48 UTC and I am parsing the date into MMMM-DD-YYYY format (Jan-27-2022) using day.js .Its working fine in chrome but firefox is returning Invalid.
import dayjs from "dayjs"
const utcDate = '2022-01-27 09:23:48 UTC'
const formatedDate = dayjs(utcDate).format("MMMM-DD-YYYY")
I have also tried the customParseFormat mentioned in the docs and some other threads
import dayjs from "dayjs"
import customParseFormat from 'dayjs/plugin/customParseFormat'
dayjs.extend(customParseFormat)
const utcDate = '2022-01-27 09:23:48 UTC'
const formatedDate = dayjs(utcDate, 'MMMM-DD-YYYY')
In both cases its returning 'Invalid Date' in firefox and safari but working fine in chrome. Is there any work around for this?