From 328398bff87b593a6a5af215cb92de541331314c Mon Sep 17 00:00:00 2001 From: Bao Nguyen Date: Sat, 18 Feb 2023 07:59:32 +0700 Subject: [PATCH] display date created, last modified in the properties window --- src/lib/utils.js | 6 ++++++ src/routes/xp/programs/properties.svelte | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/lib/utils.js b/src/lib/utils.js index 44cf30a..9a32f66 100644 --- a/src/lib/utils.js +++ b/src/lib/utils.js @@ -338,4 +338,10 @@ export function sanitize_filename(name){ export function browser_window(){ return window; +} + +export function timestamp_to_readable(timestamp){ + let date = new Date(); + date.setTime(timestamp); + return date.toString(); } \ No newline at end of file diff --git a/src/routes/xp/programs/properties.svelte b/src/routes/xp/programs/properties.svelte index b74964d..6c36648 100644 --- a/src/routes/xp/programs/properties.svelte +++ b/src/routes/xp/programs/properties.svelte @@ -35,7 +35,9 @@ ...fs_item?.type == 'file' ? [] : [ ['Contains', `${fs_item.children.filter(el => $hardDrive[el].type == 'file').length} Files, ${fs_item.children.filter(el => $hardDrive[el].type == 'folder').length} Folders`] - ] + ], + ['Date Created', utils.timestamp_to_readable(fs_item.date_created)], + ['Last Modified', utils.timestamp_to_readable(fs_item.date_modified)] ] onMount(() => { @@ -127,7 +129,7 @@
{detail[0]}
-
+
{detail[1]}