overleaf/services/web/frontend/js/features/subscription/util/is-in-free-trial.ts

10 lines
212 B
TypeScript
Raw Normal View History

export default function isInFreeTrial(trialEndsAt?: string | null) {
if (!trialEndsAt) return false
const endDate = new Date(trialEndsAt)
if (endDate.getTime() < Date.now()) return false
return true
}