From a89c7d29574c1a184e1fc773cd7bb9e126173b49 Mon Sep 17 00:00:00 2001 From: Sabe Jones Date: Wed, 9 Jun 2021 08:24:50 -0500 Subject: [PATCH] feat(content): enable quest bundle also fix some date display and a Vue error --- website/client/src/components/shops/countdownBanner.vue | 2 +- website/client/src/components/shops/quests/questInfo.vue | 7 +++---- .../client/src/components/shops/quests/questRewards.vue | 5 ++++- website/client/src/components/shops/shopItem.vue | 7 +++---- website/common/script/content/bundles.js | 3 ++- website/common/script/content/constants/events.js | 8 +++++++- 6 files changed, 20 insertions(+), 12 deletions(-) diff --git a/website/client/src/components/shops/countdownBanner.vue b/website/client/src/components/shops/countdownBanner.vue index dee2380f72..1908cd443a 100644 --- a/website/client/src/components/shops/countdownBanner.vue +++ b/website/client/src/components/shops/countdownBanner.vue @@ -78,7 +78,7 @@ export default { this.cancelAutoUpdate(); } else if (diffDuration.days() > 0) { this.limitedString = this.$t('limitedAvailabilityDays', { - days: diffDuration.days(), + days: moment(this.endDate).diff(moment(), 'days'), hours: diffDuration.hours(), minutes: diffDuration.minutes(), }); diff --git a/website/client/src/components/shops/quests/questInfo.vue b/website/client/src/components/shops/quests/questInfo.vue index 916d54e679..e29990d359 100644 --- a/website/client/src/components/shops/quests/questInfo.vue +++ b/website/client/src/components/shops/quests/questInfo.vue @@ -143,8 +143,6 @@ import svgStar from '@/assets/svg/difficulty-star.svg'; import svgStarHalf from '@/assets/svg/difficulty-star-half.svg'; import svgStarEmpty from '@/assets/svg/difficulty-star-empty.svg'; -import seasonalShopConfig from '@/../../common/script/libs/shops-seasonal.config'; - export default { props: { quest: { @@ -205,13 +203,14 @@ export default { return collect.text; }, countdownString () { - const diffDuration = moment.duration(moment(seasonalShopConfig.dateRange.end).diff(moment())); + if (!this.quest.event) return; + const diffDuration = moment.duration(moment(this.quest.event.end).diff(moment())); if (diffDuration.asSeconds() <= 0) { this.limitedString = this.$t('noLongerAvailable'); } else if (diffDuration.days() > 0) { this.limitedString = this.$t('limitedAvailabilityDays', { - days: diffDuration.days(), + days: moment(this.quest.event.end).diff(moment(), 'days'), hours: diffDuration.hours(), minutes: diffDuration.minutes(), }); diff --git a/website/client/src/components/shops/quests/questRewards.vue b/website/client/src/components/shops/quests/questRewards.vue index f8044690e9..1f11202c55 100644 --- a/website/client/src/components/shops/quests/questRewards.vue +++ b/website/client/src/components/shops/quests/questRewards.vue @@ -1,5 +1,8 @@