mirror of
https://github.com/gethomepage/homepage.git
synced 2025-12-05 21:47:48 +01:00
Feature: add date formatting option in custom api (#2228)
This commit is contained in:
@@ -123,6 +123,9 @@ module.exports = {
|
||||
i18next.services.formatter.add("percent", (value, lng, options) =>
|
||||
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",
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user