mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 06:37:23 +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();
|
this.cancelAutoUpdate();
|
||||||
} else if (diffDuration.days() > 0) {
|
} else if (diffDuration.days() > 0) {
|
||||||
this.limitedString = this.$t('limitedAvailabilityDays', {
|
this.limitedString = this.$t('limitedAvailabilityDays', {
|
||||||
days: diffDuration.days(),
|
days: moment(this.endDate).diff(moment(), 'days'),
|
||||||
hours: diffDuration.hours(),
|
hours: diffDuration.hours(),
|
||||||
minutes: diffDuration.minutes(),
|
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 svgStarHalf from '@/assets/svg/difficulty-star-half.svg';
|
||||||
import svgStarEmpty from '@/assets/svg/difficulty-star-empty.svg';
|
import svgStarEmpty from '@/assets/svg/difficulty-star-empty.svg';
|
||||||
|
|
||||||
import seasonalShopConfig from '@/../../common/script/libs/shops-seasonal.config';
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
quest: {
|
quest: {
|
||||||
@@ -205,13 +203,14 @@ export default {
|
|||||||
return collect.text;
|
return collect.text;
|
||||||
},
|
},
|
||||||
countdownString () {
|
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) {
|
if (diffDuration.asSeconds() <= 0) {
|
||||||
this.limitedString = this.$t('noLongerAvailable');
|
this.limitedString = this.$t('noLongerAvailable');
|
||||||
} else if (diffDuration.days() > 0) {
|
} else if (diffDuration.days() > 0) {
|
||||||
this.limitedString = this.$t('limitedAvailabilityDays', {
|
this.limitedString = this.$t('limitedAvailabilityDays', {
|
||||||
days: diffDuration.days(),
|
days: moment(this.quest.event.end).diff(moment(), 'days'),
|
||||||
hours: diffDuration.hours(),
|
hours: diffDuration.hours(),
|
||||||
minutes: diffDuration.minutes(),
|
minutes: diffDuration.minutes(),
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="quest-rewards">
|
<div
|
||||||
|
class="quest-rewards"
|
||||||
|
v-if="quest.drop"
|
||||||
|
>
|
||||||
<div
|
<div
|
||||||
class="header d-flex align-items-center"
|
class="header d-flex align-items-center"
|
||||||
@click="toggle"
|
@click="toggle"
|
||||||
|
|||||||
@@ -250,8 +250,6 @@ import EquipmentAttributesPopover from '@/components/inventory/equipment/attribu
|
|||||||
|
|
||||||
import QuestInfo from './quests/questInfo.vue';
|
import QuestInfo from './quests/questInfo.vue';
|
||||||
|
|
||||||
import seasonalShopConfig from '@/../../common/script/libs/shops-seasonal.config';
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
EquipmentAttributesPopover,
|
EquipmentAttributesPopover,
|
||||||
@@ -341,13 +339,14 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
countdownString () {
|
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) {
|
if (diffDuration.asSeconds() <= 0) {
|
||||||
this.limitedString = this.$t('noLongerAvailable');
|
this.limitedString = this.$t('noLongerAvailable');
|
||||||
} else if (diffDuration.days() > 0) {
|
} else if (diffDuration.days() > 0) {
|
||||||
this.limitedString = this.$t('limitedAvailabilityDays', {
|
this.limitedString = this.$t('limitedAvailabilityDays', {
|
||||||
days: diffDuration.days(),
|
days: moment(this.item.event.end).diff(moment(), 'days'),
|
||||||
hours: diffDuration.hours(),
|
hours: diffDuration.hours(),
|
||||||
minutes: diffDuration.minutes(),
|
minutes: diffDuration.minutes(),
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -38,8 +38,9 @@ const bundles = {
|
|||||||
'turtle',
|
'turtle',
|
||||||
'whale',
|
'whale',
|
||||||
],
|
],
|
||||||
|
event: EVENTS.bundle202106,
|
||||||
canBuy () {
|
canBuy () {
|
||||||
return moment().isBetween('2019-07-17', '2019-08-02');
|
return moment().isBefore(EVENTS.bundle202106.end);
|
||||||
},
|
},
|
||||||
type: 'quests',
|
type: 'quests',
|
||||||
class: 'quest_bundle_splashyPals',
|
class: 'quest_bundle_splashyPals',
|
||||||
|
|||||||
@@ -10,11 +10,17 @@ const gemsPromo = {
|
|||||||
|
|
||||||
export const EVENTS = {
|
export const EVENTS = {
|
||||||
noCurrentEvent2021: {
|
noCurrentEvent2021: {
|
||||||
start: '2021-05-31T20:00-05:00',
|
start: '2021-07-31T20:00-05:00',
|
||||||
end: '2021-08-23T08:00-05:00',
|
end: '2021-08-23T08:00-05:00',
|
||||||
season: 'normal',
|
season: 'normal',
|
||||||
npcImageSuffix: '',
|
npcImageSuffix: '',
|
||||||
},
|
},
|
||||||
|
bundle202106: {
|
||||||
|
start: '2021-06-08T08:00-05:00',
|
||||||
|
end: '2021-07-31T20:00-05:00',
|
||||||
|
season: 'normal',
|
||||||
|
npcImageSuffix: '',
|
||||||
|
},
|
||||||
potions202105: {
|
potions202105: {
|
||||||
start: '2021-05-11T08:00-05:00',
|
start: '2021-05-11T08:00-05:00',
|
||||||
end: '2021-05-31T20:00-05:00',
|
end: '2021-05-31T20:00-05:00',
|
||||||
|
|||||||
Reference in New Issue
Block a user