1 import { isWithinInterval } from 'date-fns';
3 import { BLACK_FRIDAY, CYCLE, PLANS } from '../constants';
4 import { getHas2023OfferCoupon } from '../helpers/subscription';
5 import type { PlanIDs } from '../interfaces';
7 export const isBlackFridayPeriod = () => {
8 return isWithinInterval(new Date(), { start: BLACK_FRIDAY.START, end: BLACK_FRIDAY.END });
11 export const isCyberMonday = () => {
12 return isWithinInterval(new Date(), { start: BLACK_FRIDAY.CYBER_START, end: BLACK_FRIDAY.CYBER_END });
15 export const canUpsellToVPNPassBundle = (planIDs: PlanIDs, cycle: CYCLE, couponCode?: string) => {
16 if (planIDs[PLANS.VPN] && [CYCLE.FIFTEEN, CYCLE.THIRTY].includes(cycle) && getHas2023OfferCoupon(couponCode)) {