feat: add watch dynamic graph

This commit is contained in:
Kentai Radiquum 2024-08-24 05:45:30 +05:00
parent 6e8f03e7b6
commit 7dac3c072e
Signed by: Radiquum
GPG key ID: 858E8EE696525EED
7 changed files with 133 additions and 334 deletions

View file

@ -119,12 +119,11 @@ const months = [
"дек.",
];
export function unixToDate(unix: number, type: string = "short") {
export function unixToDate(
unix: number,
type: "full" | "dayMonth" | "dayMonthYear"
) {
const date = new Date(unix * 1000);
if (type === "short")
return (
date.getDate() + " " + months[date.getMonth()] + " " + date.getFullYear()
);
if (type === "full")
return (
date.getDate() +
@ -137,6 +136,12 @@ export function unixToDate(unix: number, type: string = "short") {
":" +
date.getMinutes()
);
if (type === "dayMonth")
return date.getDate() + " " + months[date.getMonth()];
if (type === "dayMonthYear")
return (
date.getDate() + " " + months[date.getMonth()] + " " + date.getFullYear()
);
}
export const getSeasonFromUnix = (unix: number) => {