From: skjnldsv Date: Tue, 12 Nov 2024 10:30:13 +0000 (+0100) Subject: fix(files): ensure valid mtime and fallback to crtime if defined X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=42c245ce371c947c2e07bfb8032338494d25cb01;p=nextcloud-server.git fix(files): ensure valid mtime and fallback to crtime if defined Signed-off-by: skjnldsv --- diff --git a/apps/files/src/components/FileEntry.vue b/apps/files/src/components/FileEntry.vue index 659e068e08b..f6f93be1dc8 100644 --- a/apps/files/src/components/FileEntry.vue +++ b/apps/files/src/components/FileEntry.vue @@ -67,7 +67,8 @@ class="files-list__row-mtime" data-cy-files-list-row-mtime @click="openDetailsIfAvailable"> - + + {{ t('files', 'Unknown date') }} @@ -204,6 +205,19 @@ export default defineComponent({ } }, + mtime() { + // If the mtime is not a valid date, return it as is + if (this.source.mtime && !isNaN(this.source.mtime.getDate())) { + return this.source.mtime + } + + if (this.source.crtime && !isNaN(this.source.crtime.getDate())) { + return this.source.crtime + } + + return null + }, + mtimeTitle() { if (this.source.mtime) { return moment(this.source.mtime).format('LLL')