Updated intl formatters
This commit is contained in:
@@ -1,12 +1,24 @@
|
||||
const numberFormatter = new Intl.NumberFormat("en-US")
|
||||
export function numberFormatter(d: number): string {
|
||||
return new Intl.NumberFormat("en-US").format(d)
|
||||
}
|
||||
|
||||
const dateTimeFormatter = new Intl.DateTimeFormat("hr-HR", {
|
||||
year: "numeric",
|
||||
month: "numeric",
|
||||
day: "numeric",
|
||||
hour: "numeric",
|
||||
minute: "numeric",
|
||||
second: "numeric"
|
||||
})
|
||||
export function dateTimeFormatter(d: Date): string {
|
||||
return new Intl.DateTimeFormat("hr-HR", {
|
||||
year: "numeric",
|
||||
month: "numeric",
|
||||
day: "numeric",
|
||||
hour: "numeric",
|
||||
minute: "numeric",
|
||||
second: "numeric"
|
||||
}).format(d)
|
||||
}
|
||||
|
||||
export { dateTimeFormatter, numberFormatter }
|
||||
export function logTimeFormatter(d: Date): string {
|
||||
return new Intl.DateTimeFormat("hr-HR", {
|
||||
year: "numeric",
|
||||
month: "numeric",
|
||||
day: "numeric",
|
||||
hour: "numeric",
|
||||
minute: "numeric"
|
||||
}).format(d)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user