mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-14 20:40:17 -05:00
12 lines
339 B
TypeScript
12 lines
339 B
TypeScript
|
export default function freeTrialExpiresUnderSevenDays(
|
||
|
trialEndsAt?: string | null
|
||
|
) {
|
||
|
if (!trialEndsAt) return false
|
||
|
|
||
|
const sevenDaysTime = new Date()
|
||
|
sevenDaysTime.setDate(sevenDaysTime.getDate() + 7)
|
||
|
const freeTrialEndDate = new Date(trialEndsAt)
|
||
|
|
||
|
return new Date() < freeTrialEndDate && freeTrialEndDate < sevenDaysTime
|
||
|
}
|