diff options
author | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2024-11-14 14:57:41 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-14 14:57:41 +0100 |
commit | cba467370d79b4b36c3e9fb8d614d7ab276e24f7 (patch) | |
tree | be3427a60b5b935f1c0bf5278021bd5e38faedc5 /apps/files/src/components/FileEntry.vue | |
parent | c3c6a75dc5bbd3d46e1467be7847f690ff6d9f19 (diff) | |
parent | 394ca8763b9cafcfbb6dff715f477cdd7c8c518d (diff) | |
download | nextcloud-server-cba467370d79b4b36c3e9fb8d614d7ab276e24f7.tar.gz nextcloud-server-cba467370d79b4b36c3e9fb8d614d7ab276e24f7.zip |
Merge pull request #49225 from nextcloud/fix/invalid-mtime
Diffstat (limited to 'apps/files/src/components/FileEntry.vue')
-rw-r--r-- | apps/files/src/components/FileEntry.vue | 16 |
1 files changed, 15 insertions, 1 deletions
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"> - <NcDateTime v-if="source.mtime" :timestamp="source.mtime" :ignore-seconds="true" /> + <NcDateTime v-if="mtime" :timestamp="mtime" :ignore-seconds="true" /> + <span v-else>{{ t('files', 'Unknown date') }}</span> </td> <!-- View columns --> @@ -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') |