mirror of
https://github.com/Radiquum/AniX.git
synced 2025-04-29 01:19:41 +05:00
feat: add watch dynamic graph
This commit is contained in:
parent
6e8f03e7b6
commit
7dac3c072e
7 changed files with 133 additions and 334 deletions
|
@ -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) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue