feat: add popular comments viewing to the release page

This commit is contained in:
Kentai Radiquum 2024-08-02 14:12:59 +05:00
parent 237581a49c
commit b9b0590dfe
Signed by: Radiquum
GPG key ID: 858E8EE696525EED
5 changed files with 182 additions and 10 deletions

View file

@ -114,9 +114,10 @@ const months = [
"дек.",
];
export function unixToDate(unix: number) {
export function unixToDate(unix: number, type: string = "short") {
const date = new Date(unix * 1000);
return date.getDate() + " " + months[date.getMonth()] + " " + date.getFullYear();
if (type === "short") return date.getDate() + " " + months[date.getMonth()] + " " + date.getFullYear();
if (type === "full") return date.getDate() + " " + months[date.getMonth()] + " " + date.getFullYear() + ", " + date.getHours() + ":" + date.getMinutes();
}
export const getSeasonFromUnix = (unix: number) => {