From 4fea87af8a3baff8744ea9606f852f715073632c Mon Sep 17 00:00:00 2001 From: SabreCat Date: Sun, 17 Dec 2023 19:36:45 -0600 Subject: [PATCH] Squashed commit of the following: commit 0e20f421645beaf231dd607b1c1d8db62e5804e4 Author: SabreCat Date: Thu Dec 14 15:40:22 2023 -0600 fix(g1g1): don't break modal off promo season commit ca5436d05044d256303e9c5dcdf358b64467ae66 Author: SabreCat Date: Tue Nov 28 20:42:55 2023 -0600 fix(lint): move import commit 08f58318da1a06c2d94227afd3224a5571990bac Author: SabreCat Date: Tue Nov 28 20:26:14 2023 -0600 fix(vue): parenthesis commit 8701ee330365ad0615b2179b801f8e15c3109bdd Author: SabreCat Date: Tue Nov 28 20:09:30 2023 -0600 fix(g1g1): dynamically display end dates --- .../components/payments/selectUserModal.vue | 35 +++++++++++++++++-- website/common/locales/en/limited.json | 2 +- 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/website/client/src/components/payments/selectUserModal.vue b/website/client/src/components/payments/selectUserModal.vue index 3bfa32b92c..d287cf71e4 100644 --- a/website/client/src/components/payments/selectUserModal.vue +++ b/website/client/src/components/payments/selectUserModal.vue @@ -124,7 +124,14 @@ v-once class="mx-5 mt-1" > - {{ $t('g1g1Limitations') }} + {{ $t('g1g1Limitations', { + promoStartMonth, + promoStartOrdinal, + promoStartTime, + promoEndMonth, + promoEndOrdinal, + promoEndTime, + }) }}

@@ -289,6 +296,7 @@ h2 { import debounce from 'lodash/debounce'; import find from 'lodash/find'; import isUUID from 'validator/lib/isUUID'; +import moment from 'moment'; import { mapState } from '@/libs/store'; import closeIcon from '@/assets/svg/close.svg'; import bigGiftIcon from '@/assets/svg/big-gift.svg'; @@ -318,12 +326,35 @@ export default { if (this.userSearchTerm.length < 1) return true; return typeof this.foundUser._id === 'undefined'; }, - userInputInvalidIssues () { return this.userSearchTerm.length > 0 && this.userNotFound ? [this.$t('userWithUsernameOrUserIdNotFound')] : ['']; }, + promoStartMonth () { + if (!this.currentEvent) return null; + return moment(this.currentEvent.start).format('MMMM'); + }, + promoStartOrdinal () { + if (!this.currentEvent) return null; + return moment(this.currentEvent.start).format('Do'); + }, + promoStartTime () { + if (!this.currentEvent) return null; + return moment(this.currentEvent.start).format('hh:mm A'); + }, + promoEndMonth () { + if (!this.currentEvent) return null; + return moment(this.currentEvent.end).format('MMMM'); + }, + promoEndOrdinal () { + if (!this.currentEvent) return null; + return moment(this.currentEvent.end).format('Do'); + }, + promoEndTime () { + if (!this.currentEvent) return null; + return moment(this.currentEvent.end).format('hh:mm A'); + }, }, watch: { userSearchTerm: { diff --git a/website/common/locales/en/limited.json b/website/common/locales/en/limited.json index f56d188b22..09d468051d 100644 --- a/website/common/locales/en/limited.json +++ b/website/common/locales/en/limited.json @@ -250,7 +250,7 @@ "howItWorks": "How it Works", "g1g1HowItWorks": "Type in the username of the account you’d like to gift to. From there, pick the sub length you’d like to gift and check out. Your account will automatically be rewarded with the same level of subscription you just gifted.", "limitations": "Limitations", - "g1g1Limitations": "This is a limited time event that starts on December 15th at 8:00 AM ET (13:00 UTC) and will end January 8th at 11:59 PM ET (January 9th 04:59 UTC). 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.", + "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!", "gemSaleLimitations": "This promotion only applies during the limited time event. This event starts on <%= eventStartMonth %> <%= eventStartOrdinal %> at 8:00 AM EDT (12:00 UTC) and will end <%= eventEndMonth %> <%= eventEndOrdinal %> at 8:00 PM EDT (00:00 UTC). The promo offer is only available when buying Gems for yourself.",