fix date format

This commit is contained in:
2024-05-22 11:22:30 +02:00
parent a33426f3c2
commit a576a93a0b
2 changed files with 8 additions and 2 deletions

View File

@@ -11,4 +11,10 @@ export const percentFormater = new Intl.NumberFormat("en-US", {
maximumFractionDigits: 0
});
export const formatEveDate = (date?: Date | null) => !date ? '' : `${date.getUTCFullYear()}.${date.getUTCMonth() + 1}.${date.getUTCDate()} ${date.getUTCHours()}:${date.getUTCMinutes()}`;
export const timeFormat = new Intl.NumberFormat("en-US", {
minimumFractionDigits: 0,
maximumFractionDigits: 0,
minimumIntegerDigits: 2
});
export const formatEveDate = (date?: Date | null) => !date ? '' : `${date.getUTCFullYear()}.${timeFormat.format(date.getUTCMonth() + 1)}.${timeFormat.format(date.getUTCDate())} ${timeFormat.format(date.getUTCHours())}:${timeFormat.format(date.getUTCMinutes())}`;