Skip to content

Commit

Permalink
Merge pull request #46466 from Expensify/chirag-date-parse-correction
Browse files Browse the repository at this point in the history
Correcting lastDayFreeTrialDate to process UTC timestamp
  • Loading branch information
marcochavezf authored Jul 30, 2024
2 parents 0928292 + 36444f1 commit 9062c3c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/libs/SubscriptionUtils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {differenceInSeconds, fromUnixTime, isAfter, isBefore, parse as parseDate} from 'date-fns';
import {differenceInSeconds, fromUnixTime, isAfter, isBefore} from 'date-fns';
import Onyx from 'react-native-onyx';
import type {OnyxCollection, OnyxEntry} from 'react-native-onyx';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import type {BillingGraceEndPeriod, BillingStatus, Fund, FundList, Policy, StripeCustomerID} from '@src/types/onyx';
import {isEmptyObject} from '@src/types/utils/EmptyObject';
Expand Down Expand Up @@ -396,7 +395,7 @@ function hasUserFreeTrialEnded(): boolean {
}

const currentDate = new Date();
const lastDayFreeTrialDate = parseDate(lastDayFreeTrial, CONST.DATE.FNS_DATE_TIME_FORMAT_STRING, currentDate);
const lastDayFreeTrialDate = new Date(`${lastDayFreeTrial}Z`);

return isAfter(currentDate, lastDayFreeTrialDate);
}
Expand Down

0 comments on commit 9062c3c

Please sign in to comment.