diff --git a/src/components/card/CardSidebar.vue b/src/components/card/CardSidebar.vue index 8545310f0..4d2362d7c 100644 --- a/src/components/card/CardSidebar.vue +++ b/src/components/card/CardSidebar.vue @@ -108,8 +108,8 @@ export default { return this.$store.getters.cardById(this.id) }, subtitle() { - let lastModified = this.currentCard.lastModified - let createdAt = this.currentCard.createdAt + let lastModified = OC.Util.relativeModifiedDate(this.currentCard.lastModified * 1000) + let createdAt = OC.Util.relativeModifiedDate(this.currentCard.createdAt * 1000) return t('deck', 'Modified') + ': ' + lastModified + ' ' + t('deck', 'Created') + ': ' + createdAt }, diff --git a/src/components/cards/CardBadges.vue b/src/components/cards/CardBadges.vue index 047f84009..ded079ab7 100644 --- a/src/components/cards/CardBadges.vue +++ b/src/components/cards/CardBadges.vue @@ -59,7 +59,7 @@ export default { dueIcon() { let timeInHours = Math.round((Date.parse(this.card.duedate) - Date.now()) / 1000 / 60 / 60 / 24) - if (timeInHours === 1) { + if (timeInHours >= 1) { return 'icon-calendar-dark due icon next' } if (timeInHours === 0) { @@ -70,25 +70,7 @@ export default { } }, dueTimeDiff() { - let unit = 'Minutes' - let timeInMin = (Date.parse(this.card.duedate) - Date.now()) / 60000 - - if (timeInMin > 59) { - timeInMin /= 60 - unit = 'Hours' - } - - if (timeInMin > 23) { - timeInMin /= 24 - unit = 'Days' - } - - if (timeInMin > 355) { - timeInMin /= 355 - unit = 'Years' - } - - return Math.round(timeInMin) + ' ' + unit + return OC.Util.relativeModifiedDate(this.card.duedate) }, card() { return this.$store.getters.cardById(this.id)