vue-i18n
vue-i18n copied to clipboard
Customize date string delimiter
Feature request:
By default, we use vue-i18n, the string formatted use slash as delimiter, 2018/05/01, we hope to customize it as 2018-05-01.
Unfortunately, it's the specification of Intl.DateTimeFormat. As with strftime like, customization can not be done at present. 😞 In the future, Intl.NumberFormat may be supported or may be supported in the future i18n planned.
@fengerzh you can just add a custom filter like so.
filters: { delimiter(value: string) { return value.replace(/\//g, '-'); } }
what would be the problem with the standard, if vue-i18n would introduce e.g. separator as an option for dateTimeFormats (as in https://kazupon.github.io/vue-i18n/guide/datetime.html) to allow any custom separator? It is good, to default to a standard, but it should be possible, to customize that.
The jp date in vue-i18n like '6月3日(木)' ,how can i convert to '6/3(木)'
@fengerzh you can just add a custom filter like so.
filters: { delimiter(value: string) { return value.replace(/\//g, '-'); } }
Where exactly do I set this filter?