Merge pull request #3532 from nextcloud/feature/timestamps-on-created-and-modified-at-values
Timestamps on created and modified at values
This commit is contained in:
@@ -25,6 +25,7 @@
|
|||||||
:active="tabId"
|
:active="tabId"
|
||||||
:title="title"
|
:title="title"
|
||||||
:subtitle="subtitle"
|
:subtitle="subtitle"
|
||||||
|
:subtitle-tooltip="subtitleTooltip"
|
||||||
:title-editable="titleEditable"
|
:title-editable="titleEditable"
|
||||||
@update:titleEditable="handleUpdateTitleEditable"
|
@update:titleEditable="handleUpdateTitleEditable"
|
||||||
@update:title="handleUpdateTitle"
|
@update:title="handleUpdateTitle"
|
||||||
@@ -88,8 +89,10 @@ import CardSidebarTabAttachments from './CardSidebarTabAttachments'
|
|||||||
import CardSidebarTabComments from './CardSidebarTabComments'
|
import CardSidebarTabComments from './CardSidebarTabComments'
|
||||||
import CardSidebarTabActivity from './CardSidebarTabActivity'
|
import CardSidebarTabActivity from './CardSidebarTabActivity'
|
||||||
import relativeDate from '../../mixins/relativeDate'
|
import relativeDate from '../../mixins/relativeDate'
|
||||||
|
import moment from '@nextcloud/moment'
|
||||||
|
|
||||||
import { showError } from '@nextcloud/dialogs'
|
import { showError } from '@nextcloud/dialogs'
|
||||||
|
import { getLocale } from '@nextcloud/l10n'
|
||||||
|
|
||||||
const capabilities = window.OC.getCapabilities()
|
const capabilities = window.OC.getCapabilities()
|
||||||
|
|
||||||
@@ -126,6 +129,7 @@ export default {
|
|||||||
titleEditable: false,
|
titleEditable: false,
|
||||||
titleEditing: '',
|
titleEditing: '',
|
||||||
hasActivity: capabilities && capabilities.activity,
|
hasActivity: capabilities && capabilities.activity,
|
||||||
|
locale: getLocale(),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -142,6 +146,9 @@ export default {
|
|||||||
subtitle() {
|
subtitle() {
|
||||||
return t('deck', 'Modified') + ': ' + this.relativeDate(this.currentCard.lastModified * 1000) + ' ' + t('deck', 'Created') + ': ' + this.relativeDate(this.currentCard.createdAt * 1000)
|
return t('deck', 'Modified') + ': ' + this.relativeDate(this.currentCard.lastModified * 1000) + ' ' + t('deck', 'Created') + ': ' + this.relativeDate(this.currentCard.createdAt * 1000)
|
||||||
},
|
},
|
||||||
|
subtitleTooltip() {
|
||||||
|
return t('deck', 'Modified') + ': ' + this.formatDate(this.currentCard.lastModified) + '\n' + t('deck', 'Created') + ': ' + this.formatDate(this.currentCard.createdAt)
|
||||||
|
},
|
||||||
cardRichObject() {
|
cardRichObject() {
|
||||||
return {
|
return {
|
||||||
id: '' + this.currentCard.id,
|
id: '' + this.currentCard.id,
|
||||||
@@ -189,6 +196,9 @@ export default {
|
|||||||
closeModal() {
|
closeModal() {
|
||||||
this.$store.dispatch('setConfig', { cardDetailsInModal: false })
|
this.$store.dispatch('setConfig', { cardDetailsInModal: false })
|
||||||
},
|
},
|
||||||
|
formatDate(timestamp) {
|
||||||
|
return moment.unix(timestamp).locale(this.locale).format('LLLL')
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user