diff --git a/frontend/src/components/DecayInformations/DecayInformation-Decay.vue b/frontend/src/components/DecayInformations/DecayInformation-Decay.vue index 0dc00a79a..80d45e242 100644 --- a/frontend/src/components/DecayInformations/DecayInformation-Decay.vue +++ b/frontend/src/components/DecayInformations/DecayInformation-Decay.vue @@ -13,9 +13,9 @@
- {{ $n(Number(balance) - Number(decay.decay), 'decimal') }} - GDD − {{ $n(Number(decay.decay) * -1, 'decimal') }} GDD = - {{ $n(Number(balance), 'decimal') }} GDD + {{ (Number(balance) - Number(decay.decay)) | GDD }} + {{ decay.decay | GDD }} = + {{ balance | GDD }}
diff --git a/frontend/src/components/DecayInformations/DecayInformation-DecayStartblock.vue b/frontend/src/components/DecayInformations/DecayInformation-DecayStartblock.vue index 678fc9f09..2ee9ecc2c 100644 --- a/frontend/src/components/DecayInformations/DecayInformation-DecayStartblock.vue +++ b/frontend/src/components/DecayInformations/DecayInformation-DecayStartblock.vue @@ -17,12 +17,8 @@ - -
{{ $t('decay.decay') }}
-
- -
− {{ $n(decay.decay * -1, 'decimal') }}
-
+ {{ $t('decay.decay') }} + {{ decay.decay | GDD }}

@@ -32,39 +28,19 @@ - -
{{ $t('decay.sent') }}
-
{{ $t('decay.received') }}
-
- -
− {{ $n(amount * -1, 'decimal') }}
-
{{ $n(amount, 'decimal') }}
-
+ {{ $t(`decay.${typeId.toLowerCase()}`) }} + {{ amount | GDD }}
- -
{{ $t('decay.decay') }}
-
- -
− {{ $n(decay.decay * -1, 'decimal') }}
-
+ {{ $t('decay.decay') }} + {{ decay.decay | GDD }}
- -
{{ $t('decay.total') }}
-
+ {{ $t('decay.total') }} -
- − {{ $n((Number(amount) + Number(decay.decay)) * -1, 'decimal') }} -
-
- {{ $n(Number(amount) + Number(decay.decay), 'decimal') }} -
-
- {{ $n(Number(amount) + Number(decay.decay), 'decimal') }} -
+ {{ (Number(amount) + Number(decay.decay)) | GDD }}
diff --git a/frontend/src/components/DecayInformations/DecayInformation-Long.vue b/frontend/src/components/DecayInformations/DecayInformation-Long.vue index ac53b77b7..6a0b6a1c1 100644 --- a/frontend/src/components/DecayInformations/DecayInformation-Long.vue +++ b/frontend/src/components/DecayInformations/DecayInformation-Long.vue @@ -25,14 +25,7 @@
{{ $t('decay.past_time') }}
- - {{ duration.years }} {{ $t('decay.year') }}, - {{ duration.months }} {{ $t('decay.months') }}, - {{ duration.days }} {{ $t('decay.days') }}, - {{ duration.hours }} {{ $t('decay.hours') }}, - {{ duration.minutes }} {{ $t('decay.minutes') }}, - {{ duration.seconds }} {{ $t('decay.seconds') }} - + {{ durationText }} @@ -41,9 +34,7 @@
{{ $t('decay.decay') }}
- -
− {{ $n(decay.decay * -1, 'decimal') }}
-
+ {{ decay.decay | GDD }}
@@ -53,23 +44,13 @@ - -
{{ $t('decay.sent') }}
-
{{ $t('decay.received') }}
-
- -
− {{ $n(amount * -1, 'decimal') }}
-
{{ $n(amount, 'decimal') }}
-
+ {{ $t(`decay.${typeId.toLowerCase()}`) }} + {{ amount | GDD }}
- -
{{ $t('decay.decay') }}
-
- -
− {{ $n(decay.decay * -1, 'decimal') }}
-
+ {{ $t('decay.decay') }} + {{ decay.decay | GDD }}
@@ -77,15 +58,7 @@
{{ $t('decay.total') }}
-
- − {{ $n((Number(amount) + Number(decay.decay)) * -1, 'decimal') }} -
-
- {{ $n(Number(amount) + Number(decay.decay), 'decimal') }} -
-
- {{ $n(Number(amount) + Number(decay.decay), 'decimal') }} -
+ {{ (Number(amount) + Number(decay.decay)) | GDD }}
@@ -104,6 +77,17 @@ export default { duration() { return this.$moment.duration(new Date(this.decay.end) - new Date(this.decay.start))._data }, + durationText() { + const order = ['years', 'months', 'days', 'hours', 'minutes', 'seconds'] + const result = [] + order.forEach((timeSpan) => { + if (this.duration[timeSpan] > 0) { + const locale = this.$t(`decay.${timeSpan}`) + result.push(`${this.duration[timeSpan]} ${locale}`) + } + }) + return result.join(', ') + }, }, } diff --git a/frontend/src/components/DecayInformations/DecayInformation-Short.vue b/frontend/src/components/DecayInformations/DecayInformation-Short.vue index 8dba700d5..3bed4b9cc 100644 --- a/frontend/src/components/DecayInformations/DecayInformation-Short.vue +++ b/frontend/src/components/DecayInformations/DecayInformation-Short.vue @@ -1,6 +1,6 @@