fix: dont pad numbers in redis key dates

This commit is contained in:
2023-08-17 21:31:52 +02:00
parent ed3aed85ad
commit 2f9f2d81bf
6 changed files with 83 additions and 89 deletions

View File

@@ -116,11 +116,11 @@ function componentToHex(c: number) {
export function getTimeCacheKey() {
const d = new Date();
const year = d.getFullYear();
const month = d.getMonth().toString().padStart(2, "0");
const day = d.getDate().toString().padStart(2, "0");
const hour = d.getHours().toString().padStart(2, "0");
const minute = d.getMinutes().toString().padStart(2, "0");
const seconds = d.getSeconds().toString().padStart(2, "0");
const month = d.getMonth().toString();
const day = d.getDate().toString();
const hour = d.getHours().toString();
const minute = d.getMinutes().toString();
const seconds = d.getSeconds().toString();
return `${year}:${month}:${day}:${hour}:${minute}:${seconds}`;
}