From 1b6f91ea482ae57c45889093f8a28d1c46494dd0 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Thu, 8 Jul 2021 18:13:38 +0200 Subject: [PATCH] duration function more compact --- frontend/src/components/DecayInformation.vue | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/DecayInformation.vue b/frontend/src/components/DecayInformation.vue index 5179b9df1..c3f07c87b 100644 --- a/frontend/src/components/DecayInformation.vue +++ b/frontend/src/components/DecayInformation.vue @@ -74,10 +74,11 @@ export default { : '' }, duration() { - const startDate = this.$moment.unix(new Date(this.decay.decay_start)) - const endDate = this.$moment.unix(new Date(this.decay.decay_end)) - const diff = this.$moment.duration(endDate.diff(startDate)) - return diff._data + return this.$moment.duration( + this.$moment + .unix(new Date(this.decay.decay_end)) + .diff(this.$moment.unix(new Date(this.decay.decay_start))), + )._data }, }, }