My date is formatted as 2022-01-27 09:23:48 UTC and I am trying to parse it into MMMM-DD-YYYY format (Jan-27-2022) using day.js. The parsing works well in Chrome, but Firefox returns an 'Invalid' result.
import dayjs from "dayjs"
const utcDate = '2022-01-27 09:23:48 UTC'
const formatedDate = dayjs(utcDate).format("MMMM-DD-YYYY")
I have attempted to use the customParseFormat function mentioned in the documentation and other resources
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 instances, Firefox and Safari return an 'Invalid Date', while Chrome functions correctly. Is there a solution for this issue?