App icon indicating copy to clipboard operation
App copied to clipboard

[Due for payment 2026-11-19] [$175] [Auto] - Scan - Failed split scan in Group displays raw UTC time without timezone label

Open applause-bot[bot] opened this issue 1 month ago • 28 comments

If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.


Version Number: v9.5.20-0 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack: https://test-management.browserstack.com/projects/2219752/test-runs/80340021/folder/57710137/41237732/1905552540?sort=%2Bidentifier Email or phone of affected tester (no customers): [email protected] Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Windows 11/Chrome App Component: Chat Report View

Action Performed:

  1. Open the New Dot app
  2. Create a new Group chat with 2 other users
  3. Click on the + button in the composer - Split expense - Select a black image ( will make the scan fail) - Split
  4. After it fails to scan, Open the split scan - Click on Show more - Scroll down to the Date section

Expected Result:

App should label the time or display the time according to the user's time zone

Actual Result:

App display the UTC time without label

Workaround:

Unknown

Platforms:

  • [ ] Android: App
  • [ ] Android: mWeb Chrome
  • [ ] iOS: App
  • [ ] iOS: mWeb Safari
  • [ ] iOS: mWeb Chrome
  • [x] Windows: Chrome
  • [ ] MacOS: Chrome Safari

Screenshots/Videos

https://github.com/user-attachments/assets/7e82d2fa-3dab-42ed-a881-56565232135d

View all open jobs on GitHub

Applause Internal Information Exported by: Svetlana Lazutkina Bug ID: 7295031

Upwork Automation - Do Not Edit
Issue OwnerCurrent Issue Owner: @rojiphil

applause-bot[bot] avatar Oct 26 '26 13:10 applause-bot[bot]

While Applause doesn't embed attachments for this bug, here are the links for quick view: https://platform.applause.com/services/links/v1/external/8bab9628fff3a80c797f8854cc4ac23aaa9ecd1a52fa2717410d3359bbbb13d2

applause-bot[bot] avatar Oct 26 '26 13:10 applause-bot[bot]

Proposal

Please re-state the problem that we are trying to solve in this issue.

On a split scan whose receipt failed to scan, the split details page shows the Date field as a raw UTC timestamp (for example, 2026-10-26 13:45:12) instead of a date.

What is the root cause of that problem?

The confirmation list's Date field shows the transaction's created value without formatting it.

  • For split scans, created holds a full UTC datetime. The optimistic split transaction falls back to DateUtils.getDBTime(), and the backend also returns a datetime.
  • The Date field reads that value through getCreated, which returns modifiedCreated || created as-is.
  • The editable DatePicker and the read-only rows both render that string unchanged.
  • Normal expense pages, like MoneyRequestView and the date edit step, use getFormattedCreated. It drops the time and returns yyyy-MM-dd. The confirmation list's Date field skips that step.
Code references

This is not a recent regression. The unformatted read existed before the footer was split into section components in April 2026.

What changes do you think we should make in order to solve the problem?

In dateStateSelector (selectors.ts:44), use getFormattedCreated(t) instead of getCreated(t).

  • This fixes both the editable DatePicker and the read-only rows.
  • It also makes the newDate === iouCreated check in handleDateChange compare two yyyy-MM-dd values.
  • Date-only values pass through unchanged, so other flows are unaffected.
  • Add a unit test for dateStateSelector with a datetime created.

What alternative solutions did you explore? (Optional)

  • Format only readOnlyDate in DateField.tsx:167. This leaves the creator's DatePicker showing the raw value, which is likely the path in the repro.
  • Pass a date-only created from startSplitBill. This fixes only the optimistic value, not the datetime the backend returns.

Next Steps for Contributor+ team: To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/105008) to create a draft PR. To refine: @MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.


view run

MelvinBot avatar Oct 26 '26 14:10 MelvinBot

Triggered auto assignment to Contributor-plus team member for initial proposal review - @rojiphil (External)

melvin-bot[bot] avatar Oct 26 '26 14:10 melvin-bot[bot]

Job added to Upwork: https://www.upwork.com/jobs/~022114719388004471549

melvin-bot[bot] avatar Oct 26 '26 14:10 melvin-bot[bot]

Proposal

Please re-state the problem that we are trying to solve in this issue.

When a receipt scan fails in a group expense, the "Show more" details for the split scan incorrectly display a raw UTC timestamp in the "Date" field without any timezone indicator. This leads to user confusion as the displayed time is not localized.

What is the root cause of that problem?

The MoneyRequestConfirmationList component, specifically within selectors.ts, retrieves the transaction's creation date using getCreated(t). This function returns the raw UTC datetime string without applying any timezone formatting. Unlike other views like MoneyRequestView which correctly utilize getFormattedCreated(t) to present a user-friendly, localized date, the MoneyRequestConfirmationList directly renders the output of getCreated. This omission occurs because the failure to scan results in a fallback mechanism where the created field is populated with a raw UTC datetime, and the MoneyRequestConfirmationList does not apply the necessary formatting or timezone conversion.

  • File: src/components/MoneyRequestConfirmationList/sections/selectors.ts
  • Line: 44 - iouCreated: getCreated(t) incorrectly uses the raw UTC value.
  • File: src/components/MoneyRequestConfirmationList/sections/DateField.tsx
  • Lines: 136-138 - The DatePicker component receives this raw UTC string.
  • Lines: 167-192 - The read-only rows also display this raw UTC string.
  • File: src/libs/TransactionUtils/index.ts
  • Lines: 992-1002 - Defines getCreated (raw) and getFormattedCreated (formatted with formatWithUTCTimeZone). The former is used, the latter is not.
  • File: src/libs/TransactionUtils/buildOptimisticTransaction.ts
  • Line: 220 - startSplitBill logic leads to DateUtils.getDBTime() which is a UTC timestamp when no created is explicitly passed.

What changes do you think we should make in order to solve the problem?

To address this, we must ensure that the created timestamp is consistently formatted with timezone information when displayed in the MoneyRequestConfirmationList. The most surgical approach is to replace getCreated(t) with getFormattedCreated(t) within the dateStateSelector in selectors.ts. This change directly targets the retrieval of the date value and leverages the existing utility function designed for user-friendly, localized date display.

--- a/src/components/MoneyRequestConfirmationList/sections/selectors.ts
+++ b/src/components/MoneyRequestConfirmationList/sections/selectors.ts
@@ -41,7 +41,7 @@
  * Selector for date field
  */
 export const dateStateSelector = createSelector([transactionDateSelector], (t) => ({
-  iouCreated: getCreated(t),
+  iouCreated: getFormattedCreated(t),
   date: getDateFromTransaction(t),
   pendingAction: t.pendingAction,
   type: t.type,

This modification will:

  1. Correctly Format Date: Apply timezone formatting to the iouCreated value, resolving the display of raw UTC time.
  2. Unified Logic: Ensure consistency by using getFormattedCreated across different views, mirroring the behavior of MoneyRequestView.
  3. Maintain Reproducibility: The comparison newDate === iouCreated in handleDateChange will now compare two similarly formatted date strings (yyyy-MM-dd), maintaining the intended functionality of the date picker.
  4. Minimize Blast Radius: This change is localized to the selectors.ts file, directly impacting only the data retrieval for the date field in this specific component, thus avoiding unintended side effects on other parts of the application.

What alternative solutions did you explore? (Optional)

  1. Formatting readOnlyDate in DateField.tsx:167: This approach was considered but rejected because it would only fix the read-only display. The creator of the split expense, who is more likely to interact with the date picker for editing, would still see the raw UTC value. This is a partial fix and doesn't address the root cause of the display issue for all users in this context.
  2. Passing a date-only created from startSplitBill: This was deemed insufficient because it would only correct the optimistic local state. The backend could still return a full UTC datetime, and without consistent formatting at the display layer, the problem would re-emerge when the backend response is processed. The current proposal directly fixes the display logic, ensuring consistency regardless of the backend's precise datetime format.

What automated tests can you add to prevent this from re-occurring?

A new Jest unit test should be added to src/components/MoneyRequestConfirmationList/sections/selectors.test.ts to specifically verify the behavior of dateStateSelector when a transaction has a created timestamp.

Jest Unit Test Case:

import { dateStateSelector } from './selectors'; // Assuming selectors.ts is in the same directory
import { mockTransaction } from '../../../../tests/utils/Expensify'; // Adjust path as necessary

describe('dateStateSelector', () => {
  it('should format the created timestamp correctly when it exists', () => {
    const transaction = mockTransaction({
      created: '2023-10-27T14:30:00.000Z', // Example UTC timestamp
      // Add other necessary transaction properties that dateStateSelector might depend on
      reportID: 1,
      amount: 100,
      currency: 'USD',
      isFromScan: true,
      // ... other mock properties
    });

    // Mocking the global Date object or DateUtils.getDBTime to ensure consistent behavior if needed for getCreated/getFormattedCreated
    // For this specific test, we're focusing on how selectors.ts uses the transaction object directly.
    // If getFormattedCreated relies on global Date, more sophisticated mocking might be needed.

    const selectedState = dateStateSelector(transaction);

    // We expect iouCreated to be formatted, not the raw UTC string.
    // The exact format depends on getFormattedCreated, but it should NOT be the raw string.
    // For example, if getFormattedCreated outputs 'YYYY-MM-DD', then:
    expect(selectedState.iouCreated).toBe('2023-10-27'); // This assertion needs to match the output of getFormattedCreated
    // If getFormattedCreated includes time with timezone, adjust assertion accordingly.
    // For instance, if it's 'YYYY-MM-DD HH:mm:ss ZZ':
    // expect(selectedState.iouCreated).toBe('2023-10-27 14:30:00 UTC'); // Example format

    // Verify other selectors are also correctly populated
    expect(selectedState.date).toBe('10/27/2023'); // Assuming getDateFromTransaction format
    expect(selectedState.pendingAction).toBeUndefined();
    expect(selectedState.type).toBe('expense'); // Example type
  });

  it('should handle cases where created timestamp might be missing or null', () => {
    const transaction = mockTransaction({
      created: null, // or undefined
      reportID: 1,
      amount: 100,
      currency: 'USD',
      isFromScan: true,
      // ... other mock properties
    });

    const selectedState = dateStateSelector(transaction);

    // If created is null, iouCreated should likely be null or a default value.
    // This depends on the fallback logic in selectors or TransactionUtils.
    // If getFormattedCreated(null) returns null or an empty string:
    expect(selectedState.iouCreated).toBeNull(); // Or '' or some other expected default
    expect(selectedState.date).toBe('10/27/1970'); // Default date if transaction.date is null and dateUtils.getDBTime is used
  });
});

This test suite will ensure that the dateStateSelector correctly processes created timestamps and produces a formatted output, preventing the recurrence of displaying raw UTC values. It also covers a basic case for missing created timestamps.

Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~01b60d704ba377be83

camesenin avatar Oct 26 '26 14:10 camesenin

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

melvin-bot[bot] avatar Oct 26 '26 14:10 melvin-bot[bot]

Proposal

Please re-state the problem that we are trying to solve in this issue.

When a receipt scan fails on a split expense in a Group chat, opening the split details (DynamicSplitBillDetailsPage) and expanding Show more displays the raw UTC timestamp (e.g. 2026-10-26 13:45:12) in the Date field instead of the formatted yyyy-MM-dd date.

What is the root cause of that problem?

  1. startSplitBill (src/libs/actions/IOU/Split.ts:557-573) creates the group transaction without an explicit created. buildOptimisticTransaction (src/libs/TransactionUtils/buildOptimisticTransaction.ts:220) therefore uses DateUtils.getDBTime(). Its implementation (src/libs/DateUtils.ts:408-420) produces a UTC datetime with milliseconds, not a date-only value. Scan failure exposes this value; failure is not what creates the timestamp.
  2. MoneyRequestConfirmationList selects ScanConfirmationList for scan transactions (src/components/MoneyRequestConfirmationList/index.tsx:38-40). The date field subscribes through useTransactionSelector (src/components/MoneyRequestConfirmationList/sections/DateField.tsx:67-70), which selects the split draft in split-edit mode and otherwise the draft/existing transaction (src/components/MoneyRequestConfirmationList/sections/useTransactionSelector.ts:17-22).
  3. dateStateSelector (src/components/MoneyRequestConfirmationList/sections/selectors.ts:39-52) returns iouCreated: getCreated(t). getCreated (src/libs/TransactionUtils/index.ts:992-994) returns modifiedCreated when truthy, otherwise created or '', without formatting.
  4. The editable DatePicker receives that raw value (src/components/MoneyRequestConfirmationList/sections/DateField.tsx:136-138); the read-only branches use it through readOnlyDate (src/components/MoneyRequestConfirmationList/sections/DateField.tsx:167-192). The same raw value participates in the equality guard in handleDateChange (src/components/MoneyRequestConfirmationList/sections/DateField.tsx:89-101), so selecting the same calendar date can unnecessarily write the split draft.
  5. The existing date-edit screen already uses getFormattedCreated (src/pages/iou/request/step/DynamicIOURequestStepDate.tsx:105,122). That helper (src/libs/TransactionUtils/index.ts:999-1002) delegates to formatWithUTCTimeZone (src/libs/DateUtils.ts:792-800). It formats the UTC calendar date using the default date format and returns '' for invalid or empty input. No conversion to the viewer's local timezone is needed for this date-only field.

What changes do you think we should make in order to solve the problem?

In src/components/MoneyRequestConfirmationList/sections/selectors.ts, replace getCreated with getFormattedCreated inside dateStateSelector:

--- a/src/components/MoneyRequestConfirmationList/sections/selectors.ts
+++ b/src/components/MoneyRequestConfirmationList/sections/selectors.ts
@@ -1,8 +1,8 @@
 import {canSendInvoice} from '@libs/PolicyUtils';
 import {
     getCategory,
-    getCreated,
     getCurrency,
+    getFormattedCreated,
     getMerchant,
     getTag,
     getTagForDisplay,
@@ -41,7 +41,7 @@
         return undefined;
     }
     return {
-        iouCreated: getCreated(t),
+        iouCreated: getFormattedCreated(t),
         isMissing: isCreatedMissing(t),
         hasReceipt: hasReceipt(t),
         isCreatedSet: t.isCreatedSet ?? false,

Why this is the cleanest, lowest-blast-radius fix:

  • Both the editable <DatePicker> (src/components/MoneyRequestConfirmationList/sections/DateField.tsx:138) for the split creator and the read-only rows (src/components/MoneyRequestConfirmationList/sections/DateField.tsx:167-192) for other group participants receive a normalized yyyy-MM-dd string (with the existing current-date fallback in read-only rows when empty).
  • handleDateChange (src/components/MoneyRequestConfirmationList/sections/DateField.tsx:96) compares two yyyy-MM-dd strings (newDate === iouCreated), matching src/pages/iou/request/step/DynamicIOURequestStepDate.tsx:105,122.
  • Transactions that already store created as yyyy-MM-dd pass through getFormattedCreated unchanged.

Regression coverage to add:

  • Test the exported dateStateSelector with created: '2026-10-26 00:30:00.000' and expect iouCreated === '2026-10-26', including in a non-UTC timezone so the date cannot shift to the previous day.
  • Cover a date-only value, a truthy modifiedCreated overriding created, an empty/invalid date returning '', and an absent transaction returning undefined.
  • Verify both editable and read-only failed-scan details. Selecting the already displayed date must not write a split draft when shouldShowEmptyDate is false; when it is true, the existing write that marks the date as chosen must still occur. Keep missing-date flags and the read-only fallback unchanged.

What alternative solutions did you explore? (Optional)

  • Formatting inside DateField.tsx only: Formatting iouCreated locally inside DateField.tsx would leave dateStateSelector returning raw timestamps to any consumer of DateState.iouCreated. Normalizing in dateStateSelector uses the same date normalization as DynamicIOURequestStepDate.
  • Passing a yyyy-MM-dd created in startSplitBill: Only changes newly created optimistic data; it does not normalize existing transactions or a datetime supplied by a server response. Formatting at the selector handles all these sources.

shilo1979jk avatar Oct 26 '26 14:10 shilo1979jk

Proposal

Please re-state the problem that we are trying to solve in this issue.

After a failed receipt scan on a split expense in a Group chat, opening the split details and expanding Show more shows the Date field as a raw UTC timestamp (for example, 2026-10-26 13:45:12) instead of a date.

What is the root cause of that problem?

For split scans, transaction.created holds a full UTC datetime: startSplitBill never passes a created value, so the optimistic transaction falls back to DateUtils.getDBTime(), and the backend also returns a datetime. MoneyRequestConfirmationList's selectors.ts sets iouCreated via getCreated, which returns modifiedCreated or created as-is, and DateField.tsx passes that raw value to the DatePicker and to the read-only rows. Normal expense pages go through getFormattedCreated, which drops the time and returns yyyy-MM-dd; the confirmation list skips that formatting step.

What changes are you going to make to fix the problem?

Format at the display layer only: in the confirmation-list selector (or DateField), derive the displayed date with getFormattedCreated instead of raw getCreated, so both the editable DatePicker and the read-only rows show yyyy-MM-dd, matching MoneyRequestView. Do not change transaction.created itself, since other flows rely on the full datetime. Keep the date-edit submit path writing back a date-only value as it does for normal expenses.

What will you verify?

Repro the failed split scan in a Group chat, open split details, expand Show more, and confirm Date shows yyyy-MM-dd. Confirm a normal (non-split) expense date is unchanged, and confirm editing the date on the split still saves correctly.

khizzcr7 avatar Oct 26 '26 18:10 khizzcr7

Proposal

Please re-state the problem that we are trying to solve in this issue.

When a receipt scan fails on a split expense in a Group chat, opening the split bill details and expanding "Show more" displays a raw UTC datetime timestamp (e.g. 2026-10-26 13:45:12) in the "Date" field instead of a properly formatted calendar date (e.g. YYYY-MM-DD or localized date).

What is the root cause of that problem?

In src/libs/actions/IOU/Split.ts, inside startSplitBill: When creating the initial optimistic split transaction via buildOptimisticTransaction:

buildOptimisticTransaction({
    transactionParams: {
        amount: 0,
        currency,
        reportID: CONST.REPORT.SPLIT_REPORT_ID,
        comment: parsedComment,
        merchant: CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT,
        receipt,
        category,
        tag,
        taxCode,
        taxAmount,
        taxValue,
        billable,
        reimbursable,
    },
});

The created field is omitted from transactionParams. When omitted, buildOptimisticTransaction (in src/libs/TransactionUtils/index.ts) defaults to: created: DateUtils.getDBTime() which produces a full UTC database datetime timestamp string (YYYY-MM-DD HH:MM:SS).

When the split details page renders this transaction, the Date field directly displays the raw transaction.created string instead of formatting it into a standard date string via DateUtils.extractDate or DateUtils.formatToLocal.

What changes do you think we should make in order to solve the problem?

  1. Provide a formatted date in startSplitBill: In src/libs/actions/IOU/Split.ts, explicitly set created using DateUtils.extractDate (or standard DateUtils.getDBTime()) so the optimistic transaction starts with a standardized date format consistent with other manual/split transactions:
created: DateUtils.extractDate(DateUtils.getDBTime()),
  1. Ensure consistent formatting in the confirmation / details view: In the split bill confirmation / details selectors where the Date field is mapped, ensure transaction.created is normalized with DateUtils.formatToLocal(created, CONST.DATE.FNS_FORMAT_STRING) so that even if a backend sync delivers a full UTC timestamp, the UI always safely renders the localized calendar date rather than raw UTC database text.

What alternative solutions did you explore? (Optional)

Formatting the timestamp only inside the leaf display component; however, fixing created at the point of optimistic transaction construction in Split.ts ensures consistency across Onyx store subscribers, search filters, and transaction history without localized discrepancies.

Test Result / Verification:

  1. Open a Group chat.
  2. Initiate a Split expense with a receipt scan (using an image that fails receipt scanning, or manually trigger scan failure in staging).
  3. Open the resulting split expense details.
  4. Expand "Show more" and inspect the "Date" field.
  5. Verify the Date field displays a clean, localized date (e.g., Oct 26, 2026 / 2026-10-26) with no raw UTC timestamp or time components shown.

Enes2553 avatar Oct 26 '26 19:10 Enes2553

Contributor Details

  • Your Expensify account email: [email protected]
  • Upwork Profile Link: https://www.upwork.com/freelancers/~016c1aa34b51059d42

Proposal

Please re-state the problem that we are trying to solve in this issue.

When a receipt scan fails on a split expense in a Group chat, opening the split bill details and expanding "Show more" displays a raw UTC database timestamp string (e.g. 2026-10-26 13:45:12) in the "Date" field instead of a properly formatted, localized calendar date.

What is the root cause of that problem?

There are two contributing factors:

  1. In src/libs/actions/IOU/Split.ts, startSplitBill constructs the optimistic transaction without setting the created parameter in transactionParams. As a result, buildOptimisticTransaction falls back to created: DateUtils.getDBTime(), storing a full UTC datetime string (YYYY-MM-DD HH:MM:SS) on the transaction.
  2. In src/components/ReportActionItem/MoneyRequestView.tsx (line 398): actualTransactionDate only calls getFormattedCreated(updatedTransaction) when isFromMergeTransaction && updatedTransaction is truthy; otherwise, it passes raw transactionDate (displayTransaction.created). Because transactionDate is not passed through getFormattedCreated(displayTransaction), any transaction that stores a full datetime string is rendered verbatim in <MenuItemField.Row name={dateDescription} value={actualTransactionDate} /> without stripping the time or applying local date formatting.

What changes do you think we should make in order to solve the problem?

  1. In src/components/ReportActionItem/MoneyRequestView.tsx: Ensure actualTransactionDate formats displayTransaction via getFormattedCreated: const actualTransactionDate = isFromMergeTransaction && updatedTransaction ? getFormattedCreated(updatedTransaction) : getFormattedCreated(displayTransaction); This guarantees that regardless of whether the transaction created date arrives as a full database timestamp or date string, the view always renders a standard localized date.
  2. In src/libs/actions/IOU/Split.ts: In startSplitBill, explicitly provide created: DateUtils.extractDate(DateUtils.getDBTime()) in transactionParams so the optimistic transaction starts with a normalized date string.

What alternative solutions did you explore? (Optional)

Formatting only in Split.ts was considered, but updating actualTransactionDate in MoneyRequestView.tsx with getFormattedCreated(displayTransaction) is more resilient because it also safeguards existing transactions synced from the backend that contain full database timestamps.

Test Result / Verification:

  1. Open a Group chat with 2 or more participants.
  2. Click the + button in the composer -> Split expense -> Upload an unparseable/blank receipt image to trigger a scan failure.
  3. Open the resulting split expense report.
  4. Click "Show more" and inspect the "Date" field.
  5. Verify the Date field displays a clean, localized date (e.g. Oct 26, 2026 or YYYY-MM-DD) with no raw UTC timestamp or time components shown.

bhomvratrai-glitch avatar Oct 26 '26 22:10 bhomvratrai-glitch

Proposal

Please re-state the problem that we are trying to solve in this issue.

When a receipt scan fails on a split expense in a Group chat, opening the split details page (DynamicSplitBillDetailsPage) and expanding Show more displays a raw UTC datetime string (e.g., 2026-10-26 13:45:12) in the Date field instead of a formatted yyyy-MM-dd calendar date.

What is the root cause of that problem?

  1. When startSplitBill (src/libs/actions/IOU/Split.ts) builds the optimistic group split transaction without passing an explicit created date, buildOptimisticTransaction (src/libs/TransactionUtils/buildOptimisticTransaction.ts:220) defaults created to DateUtils.getDBTime(), which returns a full UTC timestamp (yyyy-MM-dd HH:mm:ss.SSS), and the backend also returns a full datetime on split scan transactions.
  2. On the split confirmation list (ScanConfirmationList), DateField (src/components/MoneyRequestConfirmationList/sections/DateField.tsx:67-70) selects iouCreated via dateStateSelector (src/components/MoneyRequestConfirmationList/sections/selectors.ts:39-52).
  3. In src/components/MoneyRequestConfirmationList/sections/selectors.ts (line 44), dateStateSelector calls getCreated(t) instead of getFormattedCreated(t). Because getCreated (src/libs/TransactionUtils/index.ts:992-994) returns modifiedCreated || created untouched without formatting via DateUtils.formatWithUTCTimeZone, both the editable <DatePicker> (DateField.tsx:136-138) for the split creator and the read-only date rows (DateField.tsx:167-192) for other participants display the raw UTC datetime string.
  4. In addition, handleDateChange (DateField.tsx:96) checks if (newDate === iouCreated && !shouldShowEmptyDate) where newDate is yyyy-MM-dd, so a raw datetime in iouCreated causes the equality guard to fail even when the same calendar date is picked.

What changes do you think we should make in order to solve the problem?

In src/components/MoneyRequestConfirmationList/sections/selectors.ts, replace getCreated(t) with getFormattedCreated(t) in dateStateSelector (matching MoneyRequestView and DynamicIOURequestStepDate.tsx):

// Before (src/components/MoneyRequestConfirmationList/sections/selectors.ts)
import {canSendInvoice} from '@libs/PolicyUtils';
import {
    getCategory,
    getCreated,
    getCurrency,
    getMerchant,
    getTag,
    getTagForDisplay,
    hasReceipt,
    isAmountMissing,
    isCreatedMissing,
    isFailedScanAmountPlaceholder,
    isMerchantMissing,
    isScanRequest,
    willFieldBeAutomaticallyFilled,
} from '@libs/TransactionUtils';
...
const dateStateSelector = (t: OnyxEntry<Transaction>): DateState | undefined => {
    if (!t) {
        return undefined;
    }
    return {
        iouCreated: getCreated(t),
        isMissing: isCreatedMissing(t),
        hasReceipt: hasReceipt(t),
        isCreatedSet: t.isCreatedSet ?? false,
        iouRequestType: t.iouRequestType,
        isAmountSet: t.isAmountSet ?? false,
        isMerchantSet: t.isMerchantSet ?? false,
    };
};

// After (src/components/MoneyRequestConfirmationList/sections/selectors.ts)
import {canSendInvoice} from '@libs/PolicyUtils';
import {
    getCategory,
    getCurrency,
    getFormattedCreated,
    getMerchant,
    getTag,
    getTagForDisplay,
    hasReceipt,
    isAmountMissing,
    isCreatedMissing,
    isFailedScanAmountPlaceholder,
    isMerchantMissing,
    isScanRequest,
    willFieldBeAutomaticallyFilled,
} from '@libs/TransactionUtils';
...
const dateStateSelector = (t: OnyxEntry<Transaction>): DateState | undefined => {
    if (!t) {
        return undefined;
    }
    return {
        iouCreated: getFormattedCreated(t),
        isMissing: isCreatedMissing(t),
        hasReceipt: hasReceipt(t),
        isCreatedSet: t.isCreatedSet ?? false,
        iouRequestType: t.iouRequestType,
        isAmountSet: t.isAmountSet ?? false,
        isMerchantSet: t.isMerchantSet ?? false,
    };
};

What alternative solutions did you explore? (Optional)

  • Formatting only readOnlyDate in DateField.tsx:167 was rejected because the split creator sees the editable <DatePicker> branch (DateField.tsx:136-138) when scan fields are missing, and handleDateChange (DateField.tsx:96) also relies on iouCreated being formatted as yyyy-MM-dd.
  • Passing a date-only created string in startSplitBill only changes optimistic local data and would not format full datetime strings returned by the server. Normalizing in dateStateSelector handles all sources consistently.

weaieverything avatar Oct 27 '26 04:10 weaieverything

Proposal

Please re-state the problem that we are trying to solve in this issue.

When a receipt scan fails on a split expense in a Group chat, opening the split details page (DynamicSplitBillDetailsPage) and expanding Show more displays a raw UTC datetime string (e.g. 2026-10-26 13:45:12) in the Date field without a timezone label instead of a formatted yyyy-MM-dd calendar date.

What is the root cause of that problem?

  1. Split scan transactions store a full UTC datetime in created:
  2. dateStateSelector reads raw getCreated(t) instead of getFormattedCreated(t):

What changes do you think we should make in order to solve the problem?

In src/components/MoneyRequestConfirmationList/sections/selectors.ts:

  1. Import getFormattedCreated instead of getCreated from @libs/TransactionUtils (lines 2-15).
  2. In dateStateSelector (line 43), use getFormattedCreated(t):
    const dateStateSelector = (t: OnyxEntry<Transaction>): DateState | undefined => {
        if (!t) {
            return undefined;
        }
        return {
            iouCreated: getFormattedCreated(t),
            isMissing: isCreatedMissing(t),
            hasReceipt: hasReceipt(t),
            isCreatedSet: t.isCreatedSet ?? false,
            iouRequestType: t.iouRequestType,
            isAmountSet: t.isAmountSet ?? false,
            isMerchantSet: t.isMerchantSet ?? false,
        };
    };
    
  3. Add a unit test verifying that dateStateSelector normalizes a full UTC datetime created value (e.g. '2026-10-26 13:45:12.000') to '2026-10-26'.

What alternative solutions did you explore? (Optional)

  • Formatting only readOnlyDate in DateField.tsx:166: Rejected because the split creator sees the editable <DatePicker> (DateField.tsx:137) when scan fields are missing, and handleDateChange (DateField.tsx:96) also compares newDate === iouCreated using yyyy-MM-dd.
  • Passing a date-only created string in startSplitBill: Rejected as a standalone fix because it only affects the optimistic transaction and would not format full datetime strings returned by the server.

Contributor details

Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~0105126232377c4c5c

ayolyn avatar Oct 27 '26 13:10 ayolyn

@rojiphil Whoops! This issue is 2 days overdue. Let's get this updated quick!

melvin-bot[bot] avatar Oct 29 '26 21:10 melvin-bot[bot]

Proposal

Please re-state the problem that we are trying to solve in this issue.

When selecting a workspace expense that has no merchant set, the confirmation / preview date row displays the raw unformatted timestamp or incorrect date string instead of the properly formatted transaction creation date (YYYY-MM-DD).

What is the root cause of that problem?

In src/components/MoneyRequestConfirmationList/sections/selectors.ts (around line 45), dateStateSelector computes the transaction date using: s const created = getCreated(t); Unlike ConfirmationList (which calls getFormattedCreated(transaction) from TransactionUtils), getCreated(t) returns the raw ransaction.modifiedCreated || transaction.created string without stripping time components (YYYY-MM-DD HH:mm:ss / ISO string) into yyyy-MM-dd via DateUtils.formatWithUTCTimeZone.

What changes do you think we should make in order to solve the problem?

In src/components/MoneyRequestConfirmationList/sections/selectors.ts:

  1. Import getFormattedCreated (instead of getCreated) from @libs/TransactionUtils.
  2. In dateStateSelector (line 45), replace getCreated(t) with getFormattedCreated(t): s const created = getFormattedCreated(t); This ensures dateStateSelector normalizes modifiedCreated / created into yyyy-MM-dd consistently with the rest of the confirmation flow.

What alternative solutions did you explore? (Optional)

Formatting the date inside the UI component directly was considered, but normalizing inside dateStateSelector via getFormattedCreated(t) keeps the selector memoized and prevents unnecessary re-renders when different time suffixes map to the same calendar date.

duongynhi000005-oss avatar Nov 01 '26 18:11 duongynhi000005-oss

@MelvinBot implement this. The root cause is that the confirmation list Date field renders the raw created timestamp without formatting.

In dateStateSelector (src/components/MoneyRequestConfirmationList/sections/selectors.ts), replace getCreated with getFormattedCreated for iouCreated, and swap the import. Leave the rest of the selector, the stored created value, and startSplitBill unchanged.

Show the UTC calendar date as yyyy-MM-dd, the same as MoneyRequestView and DynamicIOURequestStepDate. This covers the creator's DatePicker and the read-only row after Show more. handleDateChange will then compare two yyyy-MM-dd strings.

Add cases to tests/unit/components/MoneyRequestConfirmationList/selectorsTest.ts:

  • created: '2026-10-26 13:45:12.000' → iouCreated === '2026-10-26'
  • created: '2026-10-26 00:30:00.000' → iouCreated === '2026-10-26'
  • a date-only created is unchanged
  • modifiedCreated overrides created
  • an empty or invalid created returns ''
  • an undefined transaction returns undefined

rojiphil avatar Nov 02 '26 09:11 rojiphil

🤖 Draft PR created: https://github.com/Expensify/App/pull/105606 Please mark it as "Ready for review" or ask me to do that for you when it is ready for review.

dateStateSelector now uses getFormattedCreated instead of getCreated, so the confirmation list Date field shows the UTC date as yyyy-MM-dd. The stored created value and startSplitBill are unchanged.

Checks run
  • I added the 6 dateStateSelector cases you listed to selectorsTest.ts. All 13 tests in the file pass.
  • All 21 related suites pass (626 tests), including the MoneyRequestConfirmationList suites and TransactionUtilsTest.
  • npm run typecheck, npm run lint-changed, and npm run spell-changed pass.
  • I didn't test it in the app. Reproducing the bug needs a failed split scan in a group chat, which the test environment can't create. The Tests and QA sections are left for you.

MelvinBot avatar Nov 02 '26 10:11 MelvinBot

@rojiphil Whoops! This issue is 2 days overdue. Let's get this updated quick!

melvin-bot[bot] avatar Nov 05 '26 21:11 melvin-bot[bot]

Proposal

Please re-state the problem that we are trying to solve in this issue.

When a receipt scan split expense in a group chat fails to smartscan (or while viewing the split expense confirmation details), the Date row displays a raw UTC timestamp string (such as 2026-10-29 14:23:11.452) instead of a formatted yyyy-MM-dd date.

What is the root cause of that problem?

  1. When an optimistic split scan transaction is created (buildOptimisticTransaction), transaction.created is populated with DateUtils.getDBTime(), which returns a full UTC timestamp string (yyyy-MM-dd HH:mm:ss.SSS), and the backend also stores a full datetime for scan transactions until edited.
  2. In regular expense detail views (such as src/components/ReportActionItem/MoneyRequestView.tsx and the Date edit step), the transaction date is read via getFormattedCreated(transaction) (src/libs/TransactionUtils/index.ts), which formats created to 'yyyy-MM-dd' via DateUtils.formatWithUTCTimeZone.
  3. However, in src/components/MoneyRequestConfirmationList/selectors.ts (line 44), transactionCreated uses getCreated(t) instead of getFormattedCreated(t). Because getCreated(t) returns raw transaction.modifiedCreated || transaction.created without stripping the time component, DateField.tsx in MoneyRequestConfirmationList renders the raw UTC timestamp string directly.

What changes do you think we should make in order to solve the problem?

  1. In src/components/MoneyRequestConfirmationList/selectors.ts (line 44), replace getCreated(t) with getFormattedCreated(t) from @libs/TransactionUtils so the confirmation list Date field always receives a normalized 'yyyy-MM-dd' date string.
  2. Add a unit test in tests/unit/MoneyRequestConfirmationListTest.tsx verifying that a transaction whose created field is a full DateUtils.getDBTime() UTC timestamp displays only yyyy-MM-dd in the Date field.

What alternative solutions did you explore? (Optional)

We considered truncating DateUtils.getDBTime() at transaction creation time for split scans, but transaction.created intentionally uses getDBTime() for ordering and backend compatibility, whereas getFormattedCreated is the standard selector used across MoneyRequestView and edit steps for displaying the date in UI fields.

jeffrey-graham avatar Nov 07 '26 03:11 jeffrey-graham

📣 @jeffrey-graham! 📣 Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork. Please follow these steps:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details. Screen Shot 2022-11-16 at 4 42 54 PM Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

melvin-bot[bot] avatar Nov 07 '26 03:11 melvin-bot[bot]

MelvinBot proposal LGTM. The root cause is that the confirmation list Date field renders the raw created timestamp without formatting. 🎀👀🎀 C+ reviewed

rojiphil avatar Nov 07 '26 19:11 rojiphil