Merge pull request #2060 from nextcloud/bugfix/relative-date-card-sidebar
This commit is contained in:
@@ -261,8 +261,6 @@ export default {
|
|||||||
autosave: { enabled: false, uniqueId: 'unique' },
|
autosave: { enabled: false, uniqueId: 'unique' },
|
||||||
toolbar: false,
|
toolbar: false,
|
||||||
},
|
},
|
||||||
lastModifiedRelative: null,
|
|
||||||
lastCreatedRemative: null,
|
|
||||||
descriptionSaveTimeout: null,
|
descriptionSaveTimeout: null,
|
||||||
descriptionSaving: false,
|
descriptionSaving: false,
|
||||||
hasActivity: capabilities && capabilities.activity,
|
hasActivity: capabilities && capabilities.activity,
|
||||||
@@ -301,7 +299,7 @@ export default {
|
|||||||
return this.$store.getters.cardById(this.id)
|
return this.$store.getters.cardById(this.id)
|
||||||
},
|
},
|
||||||
subtitle() {
|
subtitle() {
|
||||||
return t('deck', 'Modified') + ': ' + this.lastModifiedRelative + ' ' + t('deck', 'Created') + ': ' + this.lastCreatedRemative
|
return t('deck', 'Modified') + ': ' + this.relativeDate(this.currentCard.lastModified * 1000) + ' ' + t('deck', 'Created') + ': ' + this.relativeDate(this.currentCard.createdAt * 1000)
|
||||||
},
|
},
|
||||||
formatedAssignables() {
|
formatedAssignables() {
|
||||||
return this.assignables.map(item => {
|
return this.assignables.map(item => {
|
||||||
@@ -348,12 +346,6 @@ export default {
|
|||||||
this.initialize()
|
this.initialize()
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
created() {
|
|
||||||
setInterval(this.updateRelativeTimestamps, 10000)
|
|
||||||
},
|
|
||||||
destroyed() {
|
|
||||||
clearInterval(this.updateRelativeTimestamps)
|
|
||||||
},
|
|
||||||
mounted() {
|
mounted() {
|
||||||
this.initialize()
|
this.initialize()
|
||||||
},
|
},
|
||||||
@@ -381,7 +373,6 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.desc = this.currentCard.description
|
this.desc = this.currentCard.description
|
||||||
this.updateRelativeTimestamps()
|
|
||||||
},
|
},
|
||||||
showEditor() {
|
showEditor() {
|
||||||
if (!this.canEdit) {
|
if (!this.canEdit) {
|
||||||
@@ -427,10 +418,6 @@ export default {
|
|||||||
this.$store.dispatch('updateCardDesc', this.copiedCard)
|
this.$store.dispatch('updateCardDesc', this.copiedCard)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
updateRelativeTimestamps() {
|
|
||||||
this.lastModifiedRelative = OC.Util.relativeModifiedDate(this.currentCard.lastModified * 1000)
|
|
||||||
this.lastCreatedRemative = OC.Util.relativeModifiedDate(this.currentCard.createdAt * 1000)
|
|
||||||
},
|
|
||||||
setDue() {
|
setDue() {
|
||||||
this.$store.dispatch('updateCardDue', this.copiedCard)
|
this.$store.dispatch('updateCardDue', this.copiedCard)
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -147,6 +147,7 @@ export default {
|
|||||||
if (existingIndex !== -1) {
|
if (existingIndex !== -1) {
|
||||||
Vue.set(state.cards[existingIndex], property, card[property])
|
Vue.set(state.cards[existingIndex], property, card[property])
|
||||||
}
|
}
|
||||||
|
Vue.set(state.cards[existingIndex], 'lastModified', Date.now() / 1000)
|
||||||
},
|
},
|
||||||
cardIncreaseAttachmentCount(state, cardId) {
|
cardIncreaseAttachmentCount(state, cardId) {
|
||||||
const existingIndex = state.cards.findIndex(_card => _card.id === cardId)
|
const existingIndex = state.cards.findIndex(_card => _card.id === cardId)
|
||||||
|
|||||||
Reference in New Issue
Block a user