diff --git a/frontend/src/components/DecayInformation.vue b/frontend/src/components/DecayInformation.vue index 8a134b490..c3f07c87b 100644 --- a/frontend/src/components/DecayInformation.vue +++ b/frontend/src/components/DecayInformation.vue @@ -39,8 +39,7 @@
{{ $t('decay.since_introduction') }}
- {{ getDuration(decay.decay_end, decay.decay_start) }} - + {{ duration.years }} {{ $t('decay.year') }}, {{ duration.months }} {{ $t('decay.months') }}, {{ duration.days }} {{ $t('decay.days') }}, @@ -68,29 +67,18 @@ export default { }, decaytyp: { type: String, default: '' }, }, - data() { - return { - a: 0, - b: 0, - duration: {}, - diff: {}, - } - }, computed: { decayStartBlockTextShort() { return this.decay.decay_start_block ? ' - Startblock Decay am: ' + this.$d(this.$moment.unix(this.decay.decay_start_block)) : '' }, - }, - methods: { - getDuration(start, end) { - this.a = new Date(start) - this.b = new Date(end) - this.a = this.$moment.unix(this.a) - this.b = this.$moment.unix(this.b) - this.diff = this.$moment.duration(this.a.diff(this.b)) - this.duration = this.diff._data + duration() { + return this.$moment.duration( + this.$moment + .unix(new Date(this.decay.decay_end)) + .diff(this.$moment.unix(new Date(this.decay.decay_start))), + )._data }, }, }