Skip to content

Commit b17e692

Browse files
authored
Merge pull request #49283 from nextcloud/backport/49225/stable29
2 parents 422251e + 04fe5e3 commit b17e692

3 files changed

Lines changed: 17 additions & 4 deletions

File tree

apps/files/src/components/FileEntry.vue

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@
8484
class="files-list__row-mtime"
8585
data-cy-files-list-row-mtime
8686
@click="openDetailsIfAvailable">
87-
<NcDateTime v-if="source.mtime" :timestamp="source.mtime" :ignore-seconds="true" />
87+
<NcDateTime v-if="mtime" :timestamp="mtime" :ignore-seconds="true" />
88+
<span v-else>{{ t('files', 'Unknown date') }}</span>
8889
</td>
8990

9091
<!-- View columns -->
@@ -238,6 +239,18 @@ export default defineComponent({
238239
color: `color-mix(in srgb, var(--color-main-text) ${ratio}%, var(--color-text-maxcontrast))`,
239240
}
240241
},
242+
mtime() {
243+
// If the mtime is not a valid date, return it as is
244+
if (this.source.mtime && !isNaN(this.source.mtime.getDate())) {
245+
return this.source.mtime
246+
}
247+
248+
if (this.source.crtime && !isNaN(this.source.crtime.getDate())) {
249+
return this.source.crtime
250+
}
251+
252+
return null
253+
},
241254
mtimeTitle() {
242255
if (this.source.mtime) {
243256
return moment(this.source.mtime).format('LLL')

dist/files-main.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/files-main.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)