aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/src/components/FileEntry.vue
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2025-04-23 20:22:28 +0200
committerFerdinand Thiessen <opensource@fthiessen.de>2025-04-23 20:22:28 +0200
commit05fecce17dd56c9ef058d1360058450aea2e869f (patch)
treea4a7ae5bd0bf8c81026cd1f977a6c656827abce9 /apps/files/src/components/FileEntry.vue
parent9bfa1e7bd995161db1ab19dab45776b5ff1a7295 (diff)
downloadnextcloud-server-05fecce17dd56c9ef058d1360058450aea2e869f.tar.gz
nextcloud-server-05fecce17dd56c9ef058d1360058450aea2e869f.zip
fix(files): share `mtime` for file entry components
Also restructure the mtime opacity calculation to work as expected also for old files. Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'apps/files/src/components/FileEntry.vue')
-rw-r--r--apps/files/src/components/FileEntry.vue25
1 files changed, 3 insertions, 22 deletions
diff --git a/apps/files/src/components/FileEntry.vue b/apps/files/src/components/FileEntry.vue
index 5ec98452b1f..9642c4709d8 100644
--- a/apps/files/src/components/FileEntry.vue
+++ b/apps/files/src/components/FileEntry.vue
@@ -64,7 +64,9 @@
class="files-list__row-mtime"
data-cy-files-list-row-mtime
@click="openDetailsIfAvailable">
- <NcDateTime v-if="mtime" :timestamp="mtime" :ignore-seconds="true" />
+ <NcDateTime v-if="mtime"
+ ignore-seconds
+ :timestamp="mtime" />
<span v-else>{{ t('files', 'Unknown date') }}</span>
</td>
@@ -86,7 +88,6 @@
import { formatFileSize } from '@nextcloud/files'
import { useHotKey } from '@nextcloud/vue/composables/useHotKey'
import { defineComponent } from 'vue'
-import moment from '@nextcloud/moment'
import NcDateTime from '@nextcloud/vue/components/NcDateTime'
import { useNavigation } from '../composables/useNavigation.ts'
@@ -206,26 +207,6 @@ export default defineComponent({
color: `color-mix(in srgb, var(--color-main-text) ${ratio}%, var(--color-text-maxcontrast))`,
}
},
-
- 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')
- }
- return ''
- },
},
created() {