Message timestamp now adds a leading zero to values under ten (minutes only)

This commit is contained in:
joschuatonn
2024-05-29 08:40:58 +02:00
parent c8d5bc5734
commit c01654c59c

View File

@@ -11,7 +11,7 @@ import { decodedTextSpanIntersectsWith } from 'typescript';
})
const date = new Date(Number(props.timestamp));
const timestampFormatted = date.getDay() + "." + date.getMonth() + "." + date.getFullYear() + ", " + date.getHours() + ":" + date.getMinutes();
const timestampFormatted = date.getDay() + "." + date.getMonth() + "." + date.getFullYear() + ", " + date.getHours() + ":" + (date.getMinutes() + '').padStart(2, '0');
</script>
<template>