Skip to content

Commit

Permalink
Merge pull request #3532 from nextcloud/feature/timestamps-on-created…
Browse files Browse the repository at this point in the history
…-and-modified-at-values

Timestamps on created and modified at values
  • Loading branch information
Julien Veyssier authored Jan 20, 2022
2 parents 4f49254 + 054c5aa commit 51dffda
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/components/card/CardSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
:active="tabId"
:title="title"
:subtitle="subtitle"
:subtitle-tooltip="subtitleTooltip"
:title-editable="titleEditable"
@update:titleEditable="handleUpdateTitleEditable"
@update:title="handleUpdateTitle"
Expand Down Expand Up @@ -88,8 +89,10 @@ import CardSidebarTabAttachments from './CardSidebarTabAttachments'
import CardSidebarTabComments from './CardSidebarTabComments'
import CardSidebarTabActivity from './CardSidebarTabActivity'
import relativeDate from '../../mixins/relativeDate'
import moment from '@nextcloud/moment'

import { showError } from '@nextcloud/dialogs'
import { getLocale } from '@nextcloud/l10n'

const capabilities = window.OC.getCapabilities()

Expand Down Expand Up @@ -126,6 +129,7 @@ export default {
titleEditable: false,
titleEditing: '',
hasActivity: capabilities && capabilities.activity,
locale: getLocale(),
}
},
computed: {
Expand All @@ -142,6 +146,9 @@ export default {
subtitle() {
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() {
return {
id: '' + this.currentCard.id,
Expand Down Expand Up @@ -189,6 +196,9 @@ export default {
closeModal() {
this.$store.dispatch('setConfig', { cardDetailsInModal: false })
},
formatDate(timestamp) {
return moment.unix(timestamp).locale(this.locale).format('LLLL')
},
},
}
</script>
Expand Down

0 comments on commit 51dffda

Please sign in to comment.