mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 06:07:21 +01:00
feat(content): enable quest bundle
also fix some date display and a Vue error
This commit is contained in:
@@ -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(),
|
||||
});
|
||||
|
||||
@@ -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(),
|
||||
});
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
<template>
|
||||
<div class="quest-rewards">
|
||||
<div
|
||||
class="quest-rewards"
|
||||
v-if="quest.drop"
|
||||
>
|
||||
<div
|
||||
class="header d-flex align-items-center"
|
||||
@click="toggle"
|
||||
|
||||
@@ -250,8 +250,6 @@ import EquipmentAttributesPopover from '@/components/inventory/equipment/attribu
|
||||
|
||||
import QuestInfo from './quests/questInfo.vue';
|
||||
|
||||
import seasonalShopConfig from '@/../../common/script/libs/shops-seasonal.config';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
EquipmentAttributesPopover,
|
||||
@@ -341,13 +339,14 @@ export default {
|
||||
};
|
||||
},
|
||||
countdownString () {
|
||||
const diffDuration = moment.duration(moment(seasonalShopConfig.dateRange.end).diff(moment()));
|
||||
if (!this.item.event) return;
|
||||
const diffDuration = moment.duration(moment(this.item.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.item.event.end).diff(moment(), 'days'),
|
||||
hours: diffDuration.hours(),
|
||||
minutes: diffDuration.minutes(),
|
||||
});
|
||||
|
||||
@@ -38,8 +38,9 @@ const bundles = {
|
||||
'turtle',
|
||||
'whale',
|
||||
],
|
||||
event: EVENTS.bundle202106,
|
||||
canBuy () {
|
||||
return moment().isBetween('2019-07-17', '2019-08-02');
|
||||
return moment().isBefore(EVENTS.bundle202106.end);
|
||||
},
|
||||
type: 'quests',
|
||||
class: 'quest_bundle_splashyPals',
|
||||
|
||||
@@ -10,11 +10,17 @@ const gemsPromo = {
|
||||
|
||||
export const EVENTS = {
|
||||
noCurrentEvent2021: {
|
||||
start: '2021-05-31T20:00-05:00',
|
||||
start: '2021-07-31T20:00-05:00',
|
||||
end: '2021-08-23T08:00-05:00',
|
||||
season: 'normal',
|
||||
npcImageSuffix: '',
|
||||
},
|
||||
bundle202106: {
|
||||
start: '2021-06-08T08:00-05:00',
|
||||
end: '2021-07-31T20:00-05:00',
|
||||
season: 'normal',
|
||||
npcImageSuffix: '',
|
||||
},
|
||||
potions202105: {
|
||||
start: '2021-05-11T08:00-05:00',
|
||||
end: '2021-05-31T20:00-05:00',
|
||||
|
||||
Reference in New Issue
Block a user