The getPricingPlans is deprecated as you can see here . But I think it’s supposed to be working.
a few comments:
-
instead of const time = new Date().getTime() you can use the shorter version: const time = Date.now()
-
The plans.filter(items => items.expiryDate.getTime() < time); will give you the expired plans, not the active plans. Think about it - if the expiry date is smaller than the current date, it means the plan got expired.