mirror of
https://github.com/nextcloud/server.git
synced 2026-06-09 08:44:07 -04:00
Merge pull request #49284 from nextcloud/backport/49225/stable30
[stable30] fix(files): ensure valid mtime and fallback to crtime if defined
This commit is contained in:
commit
6cac474944
3 changed files with 18 additions and 4 deletions
|
|
@ -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')
|
||||
|
|
|
|||
4
dist/files-main.js
vendored
4
dist/files-main.js
vendored
File diff suppressed because one or more lines are too long
2
dist/files-main.js.map
vendored
2
dist/files-main.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue