Closed AaronDewes closed 9 months ago
Thanks for the report. Would you mind sharing what browser and version you are using?
I can reproduce this in Chrome 121 and Firefox 122. I also amended the issue with the root cause:
format()
seems to default to the browser language.
parse()
should do that too in my opinion, and fall back to English if the local language fails (or something else, what's the intended behaviour is your decision, but a broken example isn't good in my opinion).
You could also just change the example to be
import { format, parse } from "@formkit/tempo"
const readable = format(new Date(), "full")
parse(readable, "full", "device")
or
import { format, parse } from "@formkit/tempo"
const readable = format(new Date(), "full", "en")
parse(readable, "full")
This should be fixed now. parse had a default locale of en
instead of device
.
Quite a few examples on the front page throw an error in a German browser:
format()
seems to default to the browser language.parse()
should do that too in my opinion, and fall back to english if the local language fails.