Skip to content

Localized Date, Datetime, Time, and Number #62

Answered by jarda-svoboda
kulturbande asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @kulturbande!

This functionality is already included in @sveltekit-i18n/parser-default.

As you can see in the parser-default example you can use modifiers (defined here and used here) to get what you need.) If build-in modifiers do not fit your needs, you can even create your own!:)

You can use either @sveltekit-i18n/base together with @sveltekit-i18n/parser-default (as presented in the example) or simply sveltekit-i18n which basically glues these two packages together.

Hope it will help.)

PS: If you'd rather use ICU message syntax take a look at @sveltekit-i18n/parser-icu – example here – it provides number and date formatters as well.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@kulturbande
Comment options

Answer selected by jarda-svoboda
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants