Closed
Description
I was originally doing the following and easily ran into a runtime error because isoString
was invalid:
jsDate <- parse isoString
let ms = getTime jsDate
I'm currently doing this instead:
parseJSDate
:: forall eff
. String
-> Eff ( locale :: LOCALE | eff ) (Maybe JSDate)
parseJSDate date = do
parsed <- parse date
pure $ if isValid parsed then Just parsed else Nothing
jsDate <- parseJSDate isoString
let ms = getTime <$> jsDate
Is there any reason to not make parse
do this by default?