changed time calculation

Signed-off-by: Jakob <jakob.roehrl@web.de>
This commit is contained in:
Jakob
2019-08-16 10:30:50 +02:00
parent 75189217b0
commit 35e7c7dbe7
2 changed files with 4 additions and 22 deletions

View File

@@ -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
},

View File

@@ -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)