mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-12 04:05:34 -05:00
ebc04e4a9d
[web] Migrate cancel subscription to React GitOrigin-RevId: 8482fd61894c8011b4c980263ae1d41f396233c6
11 lines
339 B
TypeScript
11 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
|
|
}
|