This commit is contained in:
Phillip Thelen
2024-03-06 12:02:38 +01:00
committed by Sabe Jones
parent a50c0eb1e7
commit c18e06f071
9 changed files with 49 additions and 38 deletions
@@ -181,7 +181,7 @@
</div>
</div>
<countdown-banner
v-if="item.event && item.owned == null"
v-if="item.end && item.owned == null"
:end-date="endDate"
class="limitedTime available"
/>
@@ -741,7 +741,7 @@ export default {
return (!this.user.purchased.plan.customerId && !this.user.purchased.plan.consecutive.trinkets && this.getPriceClass() === 'hourglasses');
},
endDate () {
return moment(this.item.event.end);
return moment(this.item.end);
},
totalOwned () {
return this.user.items[this.item.purchaseType][this.item.key] || 0;
@@ -470,7 +470,7 @@ export default {
return this.icons.gems;
},
endDate () {
return moment(this.item.event.end);
return moment(this.item.end);
},
},
watch: {
@@ -38,7 +38,7 @@
</div>
</div>
<div
v-if="quest.event && !abbreviated"
v-if="quest.end && !abbreviated"
class="m-auto"
>
{{ limitedString }}
@@ -210,14 +210,14 @@ export default {
return collect.text;
},
countdownString () {
if (!this.quest.event || this.purchased) return;
const diffDuration = moment.duration(moment(this.quest.event.end).diff(moment()));
if (!this.quest.end || this.purchased) return;
const diffDuration = moment.duration(moment(this.quest.end).diff(moment()));
if (diffDuration.asSeconds() <= 0) {
this.limitedString = this.$t('noLongerAvailable');
} else if (diffDuration.days() > 0 || diffDuration.months() > 0) {
this.limitedString = this.$t('limitedAvailabilityDays', {
days: moment(this.quest.event.end).diff(moment(), 'days'),
days: moment(this.quest.end).diff(moment(), 'days'),
hours: diffDuration.hours(),
minutes: diffDuration.minutes(),
});
@@ -18,7 +18,7 @@
:emptyItem="emptyItem"
></slot>
<span
v-if="item.event && item.owned == null && showEventBadge"
v-if="item.end && item.owned == null && showEventBadge"
class="badge badge-round badge-item badge-clock"
>
<span
@@ -114,7 +114,7 @@
</div>
</div>
<div
v-if="item.event && item.purchaseType !== 'quests'"
v-if="item.end && item.purchaseType !== 'quests'"
:class="item.purchaseType === 'gear' ? 'mt-4' : 'mt-2'"
>
{{ limitedString }}
@@ -370,14 +370,14 @@ export default {
};
},
countdownString () {
if (!this.item.event) return;
const diffDuration = moment.duration(moment(this.item.event.end).diff(moment()));
if (!this.item.end) return;
const diffDuration = moment.duration(moment(this.item.end).diff(moment()));
if (diffDuration.asSeconds() <= 0) {
this.limitedString = this.$t('noLongerAvailable');
} else if (diffDuration.days() > 0 || diffDuration.months() > 0) {
this.limitedString = this.$t('limitedAvailabilityDays', {
days: moment(this.item.event.end).diff(moment(), 'days'),
days: moment(this.item.end).diff(moment(), 'days'),
hours: diffDuration.hours(),
minutes: diffDuration.minutes(),
});