11import { emailSelector } from '@selectors/Session' ;
2- import { format } from 'date-fns' ;
32import { Str } from 'expensify-common' ;
43import { deepEqual } from 'fast-equals' ;
54import React , { memo , useMemo } from 'react' ;
@@ -36,7 +35,7 @@ import {
3635} from '@libs/TransactionUtils' ;
3736import tryResolveUrlFromApiRoot from '@libs/tryResolveUrlFromApiRoot' ;
3837import ToggleSettingOptionRow from '@pages/workspace/workflows/ToggleSettingsOptionRow' ;
39- import CONST from '@src/CONST' ;
38+ import CONST , { DATE_TIME_FORMAT_OPTIONS } from '@src/CONST' ;
4039import type { IOUAction , IOUType } from '@src/CONST' ;
4140import ONYXKEYS from '@src/ONYXKEYS' ;
4241import ROUTES from '@src/ROUTES' ;
@@ -265,7 +264,7 @@ function MoneyRequestConfirmationListFooter({
265264} : MoneyRequestConfirmationListFooterProps ) {
266265 const icons = useMemoizedLazyExpensifyIcons ( [ 'Stopwatch' , 'CalendarSolid' ] as const ) ;
267266 const styles = useThemeStyles ( ) ;
268- const { translate, toLocaleDigit, localeCompare} = useLocalize ( ) ;
267+ const { translate, toLocaleDigit, localeCompare, preferredLocale } = useLocalize ( ) ;
269268 const { isOffline} = useNetwork ( ) ;
270269
271270 const [ allPolicies ] = useOnyx ( ONYXKEYS . COLLECTION . POLICY , { canBeMissing : true } ) ;
@@ -280,6 +279,11 @@ function MoneyRequestConfirmationListFooter({
280279 const isUnreported = transaction ?. reportID === CONST . REPORT . UNREPORTED_REPORT_ID ;
281280 const isCreatingTrackExpense = action === CONST . IOU . ACTION . CREATE && iouType === CONST . IOU . TYPE . TRACK ;
282281
282+ const formattedCreatedDate = useMemo ( ( ) => {
283+ const formatter = new Intl . DateTimeFormat ( preferredLocale , DATE_TIME_FORMAT_OPTIONS [ CONST . DATE . FNS_FORMAT_STRING ] ) ;
284+ return formatter . format ( new Date ( iouCreated ?? Date . now ( ) ) ) ;
285+ } , [ iouCreated , preferredLocale ] ) ;
286+
283287 const decodedCategoryName = useMemo ( ( ) => getDecodedCategoryName ( iouCategory ) , [ iouCategory ] ) ;
284288
285289 const allOutstandingReports = useMemo ( ( ) => {
@@ -346,6 +350,7 @@ function MoneyRequestConfirmationListFooter({
346350 } , [ allReports , shouldUseTransactionReport , transaction ?. reportID , outstandingReportID ] ) ;
347351
348352 const reportName = useMemo ( ( ) => {
353+ // eslint-disable-next-line @typescript-eslint/no-deprecated
349354 const name = getReportName ( selectedReport , selectedPolicy ) ;
350355 if ( ! name ) {
351356 return isUnreported ? translate ( 'common.none' ) : translate ( 'iou.newReport' ) ;
@@ -624,7 +629,7 @@ function MoneyRequestConfirmationListFooter({
624629 key = { translate ( 'common.date' ) }
625630 shouldShowRightIcon = { ! isReadOnly }
626631 // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
627- title = { iouCreated || format ( new Date ( ) , CONST . DATE . FNS_FORMAT_STRING ) }
632+ title = { formattedCreatedDate }
628633 description = { translate ( 'common.date' ) }
629634 style = { [ styles . moneyRequestMenuItem ] }
630635 titleStyle = { styles . flex1 }
0 commit comments