Support locale for date formating
Open
enhancement
- Dominant language
- TypeScript
- Stars
- 9
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Description
Consider this VTL expression:
```vtl
cast(cast("2000-" || MOIS_COLLECTE || "-01", date), string, "MMMM")
```
It currently always returns `October` but we would like to return the localized name instead (`Octobre` for a french locale).
Since we are using `date-fns` for that, it way be as simple as:
- get the browser locale (`navigator.language` ?),
- infer what to use for `format` [here](https://github.com/InseeFr/Trevas-JS/blob/master/packages/trevas/src/utils/dates.js#L11), by using the [proper `date-fns` option](https://date-fns.org/docs/format#).
Contributor guide
Assessment
This issue has not been assessed yet.