Skip to content

Commit 52a46a1

Browse files
authored
Merge pull request #2060 from nextcloud/bugfix/relative-date-card-sidebar
2 parents b240fa8 + 6668cc7 commit 52a46a1

2 files changed

Lines changed: 2 additions & 14 deletions

File tree

src/components/card/CardSidebar.vue

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,6 @@ export default {
261261
autosave: { enabled: false, uniqueId: 'unique' },
262262
toolbar: false,
263263
},
264-
lastModifiedRelative: null,
265-
lastCreatedRemative: null,
266264
descriptionSaveTimeout: null,
267265
descriptionSaving: false,
268266
hasActivity: capabilities && capabilities.activity,
@@ -301,7 +299,7 @@ export default {
301299
return this.$store.getters.cardById(this.id)
302300
},
303301
subtitle() {
304-
return t('deck', 'Modified') + ': ' + this.lastModifiedRelative + ' ' + t('deck', 'Created') + ': ' + this.lastCreatedRemative
302+
return t('deck', 'Modified') + ': ' + this.relativeDate(this.currentCard.lastModified * 1000) + ' ' + t('deck', 'Created') + ': ' + this.relativeDate(this.currentCard.createdAt * 1000)
305303
},
306304
formatedAssignables() {
307305
return this.assignables.map(item => {
@@ -348,12 +346,6 @@ export default {
348346
this.initialize()
349347
},
350348
},
351-
created() {
352-
setInterval(this.updateRelativeTimestamps, 10000)
353-
},
354-
destroyed() {
355-
clearInterval(this.updateRelativeTimestamps)
356-
},
357349
mounted() {
358350
this.initialize()
359351
},
@@ -381,7 +373,6 @@ export default {
381373
}
382374
383375
this.desc = this.currentCard.description
384-
this.updateRelativeTimestamps()
385376
},
386377
showEditor() {
387378
if (!this.canEdit) {
@@ -427,10 +418,6 @@ export default {
427418
this.$store.dispatch('updateCardDesc', this.copiedCard)
428419
}
429420
},
430-
updateRelativeTimestamps() {
431-
this.lastModifiedRelative = OC.Util.relativeModifiedDate(this.currentCard.lastModified * 1000)
432-
this.lastCreatedRemative = OC.Util.relativeModifiedDate(this.currentCard.createdAt * 1000)
433-
},
434421
setDue() {
435422
this.$store.dispatch('updateCardDue', this.copiedCard)
436423
},

src/store/card.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ export default {
147147
if (existingIndex !== -1) {
148148
Vue.set(state.cards[existingIndex], property, card[property])
149149
}
150+
Vue.set(state.cards[existingIndex], 'lastModified', Date.now() / 1000)
150151
},
151152
cardIncreaseAttachmentCount(state, cardId) {
152153
const existingIndex = state.cards.findIndex(_card => _card.id === cardId)

0 commit comments

Comments
 (0)