Add date formatter to i18
This commit is contained in:
parent
f773e026d5
commit
8e60df954f
@ -123,6 +123,9 @@ module.exports = {
|
|||||||
i18next.services.formatter.add("percent", (value, lng, options) =>
|
i18next.services.formatter.add("percent", (value, lng, options) =>
|
||||||
new Intl.NumberFormat(lng, { style: "percent", ...options }).format(parseFloat(value) / 100.0),
|
new Intl.NumberFormat(lng, { style: "percent", ...options }).format(parseFloat(value) / 100.0),
|
||||||
);
|
);
|
||||||
|
i18next.services.formatter.add("date", (value, lng, options) =>
|
||||||
|
new Intl.DateTimeFormat(lng, { ...options }).format(new Date(value)),
|
||||||
|
);
|
||||||
},
|
},
|
||||||
type: "3rdParty",
|
type: "3rdParty",
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user