Squashed commit of the following:

commit 22dc77c029
Author: Kalista Payne <sabe@habitica.com>
Date:   Tue Sep 17 20:34:00 2024 -0500

    fix(event): remove UTC wording

commit c72b5dbbee
Author: Kalista Payne <sabe@habitica.com>
Date:   Tue Sep 17 20:23:49 2024 -0500

    fix(sale): use native JS for showing tz info
This commit is contained in:
Kalista Payne
2024-09-23 08:37:18 -05:00
parent 1203cbbad8
commit ffa89202e6
3 changed files with 16 additions and 22 deletions

View File

@@ -183,11 +183,10 @@
eventStartMonth: eventInfo.startMonth,
eventStartOrdinal: eventInfo.startOrdinal,
eventStartTime: eventInfo.startTime,
eventStartUTC: eventInfo.startUTC,
eventEndMonth: eventInfo.endMonth,
eventEndOrdinal: eventInfo.endOrdinal,
eventEndTime: eventInfo.endTime,
eventEndUTC: eventInfo.endUTC,
timeZone: eventInfo.timeZoneAbbrev,
}) }}
</small>
</div>
@@ -445,19 +444,24 @@ export default {
);
if (!currentEvent) return null;
// https://stackoverflow.com/questions/1954397/detect-timezone-abbreviation-using-javascript#answer-66180857
const timeZoneAbbrev = new Intl.DateTimeFormat('en-us', { timeZoneName: 'short' })
.formatToParts(new Date())
.find(part => part.type === 'timeZoneName')
.value;
return {
name: currentEvent.event,
class: currentEvent.gemsPromo ? `event-${currentEvent.event}` : '',
gemsPromo: currentEvent.gemsPromo,
promo: currentEvent.promo,
timeZoneAbbrev,
startMonth: moment(currentEvent.start).format('MMMM'),
startOrdinal: moment(currentEvent.start).format('Do'),
startTime: moment(currentEvent.start).format('hh:mm A'),
startUTC: moment(currentEvent.start).utc().format('hh:mm A'),
endMonth: moment(currentEvent.end).format('MMMM'),
endOrdinal: moment(currentEvent.end).format('Do'),
endTime: moment(currentEvent.end).format('hh:mm A'),
endUTC: moment(currentEvent.end).utc().format('hh:mm A'),
};
},
isGemsPromoActive () {

View File

@@ -238,7 +238,7 @@
"g1g1Limitations": "This is a limited time event that starts on <%= promoStartMonth %> <%= promoStartOrdinal %> at <%= promoStartTime %> and will end <%= promoEndMonth %> <%= promoEndOrdinal %> at <%= promoEndTime %>. This promotion only applies when you gift to another Habitican. If you or your gift recipient already have a subscription, the gifted subscription will add months of credit that will only be used after the current subscription is canceled or expires.",
"noLongerAvailable": "This item is no longer available.",
"gemSaleHow": "Between <%= eventStartMonth %> <%= eventStartOrdinal %> and <%= eventEndOrdinal %>, simply purchase any Gem bundle like usual and your account will be credited with the promotional amount of Gems. More Gems to spend, share, or save for any future releases!",
"gemSaleLimitationsText": "This promotion only applies during the limited time event. This event starts on <%= eventStartMonth %> <%= eventStartOrdinal %> at <%= eventStartTime %> local time (<%= eventStartUTC %> UTC) and will end <%= eventEndMonth %> <%= eventEndOrdinal %> at <%= eventEndTime %> local time (<%= eventEndUTC %> UTC). The promo offer is only available when buying Gems for yourself.",
"gemSaleLimitationsText": "This promotion only applies during the limited time event. This event starts on <%= eventStartMonth %> <%= eventStartOrdinal %> at <%= eventStartTime %> <%= timeZone %> and will end on <%= eventEndMonth %> <%= eventEndOrdinal %> at <%= eventEndTime %> <%= timeZone %>. The promo offer is only available when buying Gems for yourself.",
"anniversaryLimitations": "This is a limited time event that starts on January 30th at 8:00 AM ET (13:00 UTC) and will end February 8th at 11:59 PM ET (04:59 UTC). The Limited Edition Jubilant Gryphatrice and ten Magic Hatching Potions will be available to buy during this time. The other Gifts listed in the Four for Free section will be automatically delivered to all accounts that were active in the 30 days prior to day the gift is sent. Accounts created after the gifts are sent will not be able to claim them.",
"anniversaryLimitedDates": "January 30th to February 8th",
"limitedEvent": "Limited Event",

View File

@@ -76,23 +76,6 @@ export const REPEATING_EVENTS = {
end: new Date('1970-08-02T03:59-04:00'),
foodSeason: 'Cake',
},
fallGemFest: {
start: new Date('1970-09-23T04:00-04:00'),
end: new Date('1970-09-27T23:59-04:00'),
gemsPromo,
},
spookyGemFest: {
start: new Date('1970-10-28T04:00-04:00'),
end: new Date('1970-11-01T23:59-04:00'),
gemsPromo,
},
habitoween: {
start: new Date('1970-10-30T04:00-04:00'),
end: new Date('1970-11-01T23:59-04:00'),
foodSeason: 'Candy',
season: 'habitoween',
npcImageSuffix: '_halloween',
},
fallGemSale: {
start: new Date('1970-09-23T04:00-04:00'),
end: new Date('1970-09-27T23:59-04:00'),
@@ -105,6 +88,13 @@ export const REPEATING_EVENTS = {
event: 'spooky_extra_gems',
gemsPromo,
},
habitoween: {
start: new Date('1970-10-30T04:00-04:00'),
end: new Date('1970-11-01T23:59-04:00'),
foodSeason: 'Candy',
season: 'habitoween',
npcImageSuffix: '_halloween',
},
harvestFeast: {
start: new Date('1970-11-20T04:00-05:00'),
end: new Date('1970-12-01T03:59-05:00'),