Skip to content

Commit

Permalink
Update start date for From the beginning option
Browse files Browse the repository at this point in the history
  • Loading branch information
VickyStash committed Nov 5, 2024
1 parent 92989f1 commit 2cf0cff
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {subDays} from 'date-fns';
import React, {useMemo, useState} from 'react';
import {View} from 'react-native';
import {useOnyx} from 'react-native-onyx';
Expand Down Expand Up @@ -55,11 +56,13 @@ function TransactionStartDateStep() {
};

const submit = () => {
const date90DaysBack = DateUtils.extractDate(subDays(new Date(), 90).toString());

CompanyCards.setAssignCardStepAndData({
currentStep: CONST.COMPANY_CARD.STEP.CONFIRMATION,
data: {
dateOption: dateOptionSelected,
startDate,
startDate: dateOptionSelected === CONST.COMPANY_CARD.TRANSACTION_START_DATE_OPTIONS.FROM_BEGINNING ? date90DaysBack : startDate,
},
isEditing: false,
});
Expand Down

0 comments on commit 2cf0cff

Please sign in to comment.