feat(content): magic options

This commit is contained in:
Sabe Jones
2021-05-11 16:07:44 -05:00
parent 8a118c562b
commit 719b4ca3ea
3 changed files with 21 additions and 6 deletions

View File

@@ -10,11 +10,17 @@ const gemsPromo = {
export const EVENTS = {
noCurrentEvent2021: {
start: '2021-04-30T20:00-05:00',
start: '2021-05-31T20:00-05:00',
end: '2021-08-23T08:00-05:00',
season: 'normal',
npcImageSuffix: '',
},
potions202105: {
start: '2021-05-11T08:00-05:00',
end: '2021-05-31T20:00-05:00',
season: 'normal',
npcImageSuffix: '',
},
spring2021: {
start: '2021-03-23T08:00-05:00',
end: '2021-04-30T20:00-05:00',

View File

@@ -86,18 +86,27 @@ const premium = {
value: 2,
text: t('hatchingPotionFairy'),
limited: true,
event: EVENTS.potions202105,
_addlNotes: t('eventAvailabilityReturning', {
availableDate: t('dateEndMay'),
previousDate: t('mayYYYY', { year: 2017 }),
previousDate: t('mayYYYY', { year: 2020 }),
}),
canBuy () {
return moment().isBefore('2020-06-02');
return moment().isBefore(EVENTS.potions202105.end);
},
},
Floral: {
value: 2,
text: t('hatchingPotionFloral'),
limited: true,
event: EVENTS.potions202105,
_addlNotes: t('eventAvailabilityReturning', {
availableDate: t('dateEndMay'),
previousDate: t('mayYYYY', { year: 2016 }),
}),
canBuy () {
return moment().isBefore(EVENTS.potions202105.end);
},
},
Aquatic: {
value: 2,

View File

@@ -7,7 +7,7 @@ import {
} from '../content/constants';
const CURRENT_EVENT = find(
EVENTS, event => moment().isBetween(event.start, event.end) && Boolean(event.season),
EVENTS, event => moment().isBetween(event.start, event.end),
);
const SHOP_OPEN = CURRENT_EVENT && ['winter', 'spring', 'summer', 'fall'].includes(CURRENT_EVENT.season);
@@ -18,8 +18,8 @@ export default {
currentSeason: SHOP_OPEN ? upperFirst(CURRENT_EVENT.season) : 'Closed',
dateRange: {
start: SHOP_OPEN ? moment(CURRENT_EVENT.start) : moment().subtract(1, 'days').toDate(),
end: SHOP_OPEN ? moment(CURRENT_EVENT.end) : moment().subtract(1, 'seconds').toDate(),
start: CURRENT_EVENT ? moment(CURRENT_EVENT.start) : moment().subtract(1, 'days').toDate(),
end: CURRENT_EVENT ? moment(CURRENT_EVENT.end) : moment().subtract(1, 'seconds').toDate(),
},
availableSets: SHOP_OPEN