display date created, last modified in the properties window

This commit is contained in:
Bao Nguyen
2023-02-18 07:59:32 +07:00
parent 0edcd724fc
commit 328398bff8
2 changed files with 10 additions and 2 deletions

View File

@@ -338,4 +338,10 @@ export function sanitize_filename(name){
export function browser_window(){ export function browser_window(){
return window; return window;
}
export function timestamp_to_readable(timestamp){
let date = new Date();
date.setTime(timestamp);
return date.toString();
} }

View File

@@ -35,7 +35,9 @@
...fs_item?.type == 'file' ? [] : ...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`] ['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(() => { onMount(() => {
@@ -127,7 +129,7 @@
<div class="shrink-0 w-[70px]"> <div class="shrink-0 w-[70px]">
{detail[0]} {detail[0]}
</div> </div>
<div class="grow ml-2 break-all"> <div class="grow ml-2 {detail[0] == 'Location' ? 'break-all' : 'break-words'}">
{detail[1]} {detail[1]}
</div> </div>
</div> </div>