From 4a3113a10da6373e70a10e776fc472692d621cf3 Mon Sep 17 00:00:00 2001 From: ogerly Date: Thu, 1 Jul 2021 15:14:51 +0200 Subject: [PATCH] check decay duration timestamp --- .../AccountOverview/GddTransactionList.vue | 59 +++++++++++++++++-- 1 file changed, 54 insertions(+), 5 deletions(-) diff --git a/frontend/src/views/Pages/AccountOverview/GddTransactionList.vue b/frontend/src/views/Pages/AccountOverview/GddTransactionList.vue index 20e6c3f20..08a34e96d 100644 --- a/frontend/src/views/Pages/AccountOverview/GddTransactionList.vue +++ b/frontend/src/views/Pages/AccountOverview/GddTransactionList.vue @@ -3,7 +3,7 @@
@@ -40,11 +40,15 @@
Seit deiner letzten Transaction sind
-

{{ $moment(getDecay(item.id).decay_start).format('DDD.MM,YYYY - mm:hh:ss') }}

-

{{ $moment(getDecay(item.id).decay_end).format('DDD.MM,YYYY - mm:hh:ss') }}

+ +

item.id: {{ item.decay }}

+

decay_start: {{ getDuration(item.id) }}

+ +
{{ }} vergangen.

-
{{getDecay(item.id).balance }} Vergänglichkeit.
+ @@ -118,8 +122,53 @@ export default { }, }, methods: { + getDuration(id) { + console.log("getDuration=>", id) + //console.log( id) + //console.log("this.transactions.find(t => t.decay === decay)>", this.transactions.find(t => t.id === id)) + this.getDecay(this.transactions.find(t => t.id === id)) + }, getDecay(id){ - return this.transactions.find(t => t.id === id) + //console.log("getDecay balance=>", id.balance) + //console.log("decay_duration=>", id.decay_duration) + let startDate = new Date(id.decay_start) + startDate = this.$moment(startDate) + let endDate = new Date(id.decay_end) + endDate = this.$moment(endDate) + let diff = this.$moment.duration(endDate.diff(startDate)) + + console.log( "diff", diff ) + console.log("day", this.$moment(endDate).diff(this.$moment(startDate), 'day')) + console.log("hour", this.$moment(endDate).diff(this.$moment(startDate), 'hour')) + console.log("minute", this.$moment(endDate).diff(this.$moment(startDate), 'minute')) + console.log("second", this.$moment(endDate).diff(startDate), 'second') + + // console.log(" decay_start=>", startDate) + // console.log("this.$moment(decay_start)", this.$moment.unix(startDate).format("DD-MM-YYYY HH:mm:ss")) + // console.log("decay_end=>", endDate) + // console.log("this.$moment(decay_start)", this.$moment.unix(endDate).format("DD-MM-YYYY HH:mm:ss")) + // + // console.log("memo=>", id.memo) + // console.log("type=>", id.type) + + + // console.log("this.transactions.find(t => t.decay === decay)>", this.transactions.find(t => t.id === id)) + // if (id) { + // console.log("this.transactions.find(t => t.decay === decay)>", this.transactions.find(t => t.decay === decay)) + // const decay = this.transactions.find(t => t.decay === decay) + // const now = this.decay.decay_start; + // const then = this.decay.decay_end; + // console.log( "decay",this.decay ) + // console.log( "now", this.now) + // console.log( "then", this.then) + // + // // console.log(this.$moment().duration(this.now.diff(this.then))) + // //return this.$moment.duration(now.diff(then)) + // // return this.transactions.find(t => t.decay === decay) + // } else { + // console.log("<<< KEIN DECAY >>>") + // } + }, updateTransactions() { this.$emit('update-transactions', {