캐시 목록 페이지 추가

This commit is contained in:
static
2025-01-14 03:07:54 +09:00
parent ea0f0e4a71
commit f37df53991
10 changed files with 194 additions and 36 deletions

View File

@@ -1,6 +1,8 @@
import { get, type Writable } from "svelte/store";
import type { DirectoryInfo, FileInfo } from "$lib/stores";
export { formatDateTime } from "$lib/modules/util";
export enum SortBy {
NAME_ASC,
NAME_DESC,
@@ -28,15 +30,3 @@ export const sortEntries = <T extends DirectoryInfo | FileInfo>(
entries.sort((a, b) => sortFunc(get(a), get(b)));
};
const pad2 = (num: number) => num.toString().padStart(2, "0");
export const formatDate = (date: Date) => {
const year = date.getFullYear();
const month = date.getMonth() + 1;
const day = date.getDate();
const hours = date.getHours();
const minutes = date.getMinutes();
return `${year}. ${month}. ${day}. ${pad2(hours)}:${pad2(minutes)}`;
};