Skip to content

Commit

Permalink
Merge pull request Expensify#52015 from callstack-internal/VickyStash…
Browse files Browse the repository at this point in the history
…/bugfix/51863-card-transaction-start-date

[Workspace Feeds] Update "From the beginning" option date display
  • Loading branch information
mountiny authored Nov 5, 2024
2 parents e3452de + 2cf0cff commit ae6fde9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function ConfirmationStep({policyID, backTo}: ConfirmationStepProps) {
/>
<MenuItemWithTopDescription
description={translate('workspace.companyCards.startTransactionDate')}
title={data?.startDate}
title={data?.dateOption === CONST.COMPANY_CARD.TRANSACTION_START_DATE_OPTIONS.FROM_BEGINNING ? translate('workspace.companyCards.fromTheBeginning') : data?.startDate}
shouldShowRightIcon
onPress={() => editStep(CONST.COMPANY_CARD.STEP.TRANSACTION_START_DATE)}
/>
Expand Down
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 ae6fde9

Please sign in to comment.