Skip to content

Commit

Permalink
Merge pull request #41334 from nextcloud/fix/mtime-render
Browse files Browse the repository at this point in the history
fix(component): utilized NcDateTime component
  • Loading branch information
emoral435 authored Nov 16, 2023
2 parents 179b7bb + 75796ba commit 9a3d45b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
11 changes: 3 additions & 8 deletions apps/files/src/components/FileEntry.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
class="files-list__row-mtime"
data-cy-files-list-row-mtime
@click="openDetailsIfAvailable">
<span>{{ mtime }}</span>
<NcDateTime :timestamp="source.mtime" :ignore-seconds="true" />
</td>

<!-- View columns -->
Expand Down Expand Up @@ -122,6 +122,7 @@ import { useDragAndDropStore } from '../store/dragging.ts'
import { useFilesStore } from '../store/files.ts'
import { useRenamingStore } from '../store/renaming.ts'
import { useSelectionStore } from '../store/selection.ts'
import NcDateTime from '@nextcloud/vue/dist/Components/NcDateTime.js'
import CustomElementRender from './CustomElementRender.vue'
import FileEntryActions from './FileEntry/FileEntryActions.vue'
import FileEntryCheckbox from './FileEntry/FileEntryCheckbox.vue'
Expand All @@ -140,6 +141,7 @@ export default Vue.extend({
FileEntryCheckbox,
FileEntryName,
FileEntryPreview,
NcDateTime,
},

props: {
Expand Down Expand Up @@ -255,13 +257,6 @@ export default Vue.extend({
color: `color-mix(in srgb, var(--color-main-text) ${ratio}%, var(--color-text-maxcontrast))`,
}
},

mtime() {
if (this.source.mtime) {
return moment(this.source.mtime).fromNow()
}
return t('files_trashbin', 'A long time ago')
},
mtimeOpacity() {
const maxOpacityTime = 31 * 24 * 60 * 60 * 1000 // 31 days

Expand Down
4 changes: 2 additions & 2 deletions dist/files-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files-main.js.map

Large diffs are not rendered by default.

0 comments on commit 9a3d45b

Please sign in to comment.