From 63c55900b979ff747db615772c4b7f0e339d314f Mon Sep 17 00:00:00 2001 From: Mukher Date: Wed, 8 Jul 2026 22:10:18 +0500 Subject: [PATCH 1/4] fixed truncated Posted column in Report layout table --- .../MoneyRequestReportTableHeader.tsx | 3 +++ .../MoneyRequestReportTransactionItem.tsx | 5 ++++ .../MoneyRequestReportTransactionList.tsx | 7 ++++- .../shouldShowTransactionPostedYear.ts | 13 ++++++++++ .../shouldShowTransactionPostedYearTest.ts | 26 +++++++++++++++++++ 5 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 src/libs/TransactionUtils/shouldShowTransactionPostedYear.ts create mode 100644 tests/unit/shouldShowTransactionPostedYearTest.ts diff --git a/src/components/MoneyRequestReportView/MoneyRequestReportTableHeader.tsx b/src/components/MoneyRequestReportView/MoneyRequestReportTableHeader.tsx index 150d3393da45..d328b2b08a9e 100644 --- a/src/components/MoneyRequestReportView/MoneyRequestReportTableHeader.tsx +++ b/src/components/MoneyRequestReportView/MoneyRequestReportTableHeader.tsx @@ -16,6 +16,7 @@ type SearchTableHeaderProps = { sortOrder?: SortOrder; onSortPress: (column: SearchSortBy, order: SortOrder) => void; dateColumnSize: TableColumnSize; + postedColumnSize: TableColumnSize; amountColumnSize: TableColumnSize; taxAmountColumnSize: TableColumnSize; shouldShowSorting: boolean; @@ -27,6 +28,7 @@ function MoneyRequestReportTableHeader({ sortOrder, onSortPress, dateColumnSize, + postedColumnSize, shouldShowSorting, columns, amountColumnSize, @@ -86,6 +88,7 @@ function MoneyRequestReportTableHeader({ columns={orderedColumnConfig} shouldShowColumn={shouldShowColumn} dateColumnSize={dateColumnSize} + postedColumnSize={postedColumnSize} amountColumnSize={amountColumnSize} taxAmountColumnSize={taxAmountColumnSize} shouldShowSorting={shouldShowSorting} diff --git a/src/components/MoneyRequestReportView/MoneyRequestReportTransactionItem.tsx b/src/components/MoneyRequestReportView/MoneyRequestReportTransactionItem.tsx index 293b00073ffd..9b1830cad118 100644 --- a/src/components/MoneyRequestReportView/MoneyRequestReportTransactionItem.tsx +++ b/src/components/MoneyRequestReportView/MoneyRequestReportTransactionItem.tsx @@ -68,6 +68,9 @@ type MoneyRequestReportTransactionItemProps = { /** The size of the date column */ dateColumnSize: TableColumnSize; + /** The size of the posted column */ + postedColumnSize: TableColumnSize; + /** The size of the amount column */ amountColumnSize: TableColumnSize; @@ -122,6 +125,7 @@ function MoneyRequestReportTransactionItemBody({ handleLongPress, columns, dateColumnSize, + postedColumnSize, amountColumnSize, taxAmountColumnSize, scrollToNewTransaction, @@ -236,6 +240,7 @@ function MoneyRequestReportTransactionItemBody({ transactionThreadReportID={transactionThreadReportID} isSelected={isSelected} dateColumnSize={dateColumnSize} + postedColumnSize={postedColumnSize} amountColumnSize={amountColumnSize} taxAmountColumnSize={taxAmountColumnSize} shouldShowTooltip diff --git a/src/components/MoneyRequestReportView/MoneyRequestReportTransactionList.tsx b/src/components/MoneyRequestReportView/MoneyRequestReportTransactionList.tsx index 47ec8dff64a3..f815afff4ee7 100644 --- a/src/components/MoneyRequestReportView/MoneyRequestReportTransactionList.tsx +++ b/src/components/MoneyRequestReportView/MoneyRequestReportTransactionList.tsx @@ -58,6 +58,7 @@ import {compareValues, getColumnsToShow, getTableMinWidth, hasFlexColumn, isTran import {getPendingSubmitFollowUpAction} from '@libs/telemetry/submitFollowUpAction'; import {transactionHasRBR} from '@libs/TransactionPreviewUtils'; import {getTransactionPendingAction, getVisibleTransactionViolations, isTransactionPendingDelete, shouldShowExpenseBreakdown} from '@libs/TransactionUtils'; +import shouldShowTransactionPostedYear from '@libs/TransactionUtils/shouldShowTransactionPostedYear'; import shouldShowTransactionYear from '@libs/TransactionUtils/shouldShowTransactionYear'; import isReportOpenInSuperWideRHP from '@navigation/helpers/isReportOpenInSuperWideRHP'; @@ -567,14 +568,16 @@ function MoneyRequestReportTransactionList({ [navigateToTransactionThread, reportActions, sortedTransactions, report, visualOrderTransactionIDs], ); - const {amountColumnSize, dateColumnSize, taxAmountColumnSize} = useMemo(() => { + const {amountColumnSize, dateColumnSize, postedColumnSize, taxAmountColumnSize} = useMemo(() => { const isAmountColumnWide = transactions.some((transaction) => isTransactionAmountTooLong(transaction)); const isTaxAmountColumnWide = transactions.some((transaction) => isTransactionTaxAmountTooLong(transaction)); const shouldShowYearForSomeTransaction = transactions.some((transaction) => shouldShowTransactionYear(transaction)); + const shouldShowPostedYearForSomeTransaction = transactions.some((transaction) => shouldShowTransactionPostedYear(transaction)); return { amountColumnSize: isAmountColumnWide ? CONST.SEARCH.TABLE_COLUMN_SIZES.WIDE : CONST.SEARCH.TABLE_COLUMN_SIZES.NORMAL, taxAmountColumnSize: isTaxAmountColumnWide ? CONST.SEARCH.TABLE_COLUMN_SIZES.WIDE : CONST.SEARCH.TABLE_COLUMN_SIZES.NORMAL, dateColumnSize: shouldShowYearForSomeTransaction ? CONST.SEARCH.TABLE_COLUMN_SIZES.WIDE : CONST.SEARCH.TABLE_COLUMN_SIZES.NORMAL, + postedColumnSize: shouldShowPostedYearForSomeTransaction ? CONST.SEARCH.TABLE_COLUMN_SIZES.WIDE : CONST.SEARCH.TABLE_COLUMN_SIZES.NORMAL, }; }, [transactions]); @@ -718,6 +721,7 @@ function MoneyRequestReportTransactionList({ handleOnPress={handleOnPress} handleLongPress={handleLongPress} dateColumnSize={dateColumnSize} + postedColumnSize={postedColumnSize} amountColumnSize={amountColumnSize} taxAmountColumnSize={taxAmountColumnSize} scrollToNewTransaction={transaction.transactionID === newTransactions?.at(0)?.transactionID ? scrollToNewTransaction : undefined} @@ -827,6 +831,7 @@ function MoneyRequestReportTransactionList({ shouldRemoveTotalColumnFlex={hasFlexColumn(columnsToShow)} columns={columnsToShow} dateColumnSize={dateColumnSize} + postedColumnSize={postedColumnSize} amountColumnSize={amountColumnSize} taxAmountColumnSize={taxAmountColumnSize} onSortPress={(selectedSortBy, selectedSortOrder) => { diff --git a/src/libs/TransactionUtils/shouldShowTransactionPostedYear.ts b/src/libs/TransactionUtils/shouldShowTransactionPostedYear.ts new file mode 100644 index 000000000000..420275b23edf --- /dev/null +++ b/src/libs/TransactionUtils/shouldShowTransactionPostedYear.ts @@ -0,0 +1,13 @@ +import type {OnyxInputOrEntry, Transaction} from '@src/types/onyx'; + +function shouldShowTransactionPostedYear(transaction: OnyxInputOrEntry) { + const posted = transaction?.posted; + if (!posted) { + return false; + } + // Posted date is in the YYYYMMDD format, so we read the year from the first 4 chars (the Date constructor treats YYYYMMDD as invalid). + const postedYear = parseInt(String(posted).slice(0, 4), 10); + return postedYear !== new Date().getFullYear(); +} + +export default shouldShowTransactionPostedYear; diff --git a/tests/unit/shouldShowTransactionPostedYearTest.ts b/tests/unit/shouldShowTransactionPostedYearTest.ts new file mode 100644 index 000000000000..e3b0e84bbdee --- /dev/null +++ b/tests/unit/shouldShowTransactionPostedYearTest.ts @@ -0,0 +1,26 @@ +import shouldShowTransactionPostedYear from '@libs/TransactionUtils/shouldShowTransactionPostedYear'; + +import createRandomTransaction from '../utils/collections/transaction'; + +const currentYear = new Date().getFullYear(); +const transactionWithPosted = (posted?: string) => ({...createRandomTransaction(0), posted}); + +describe('shouldShowTransactionPostedYear', () => { + it('returns true when the posted date is in a past year (YYYYMMDD)', () => { + expect(shouldShowTransactionPostedYear(transactionWithPosted(`${currentYear - 1}1231`))).toBe(true); + }); + + it('returns false when the posted date is in the current year', () => { + expect(shouldShowTransactionPostedYear(transactionWithPosted(`${currentYear}0101`))).toBe(false); + }); + + it('returns false when there is no posted date', () => { + expect(shouldShowTransactionPostedYear(transactionWithPosted(undefined))).toBe(false); + expect(shouldShowTransactionPostedYear(transactionWithPosted(''))).toBe(false); + }); + + it('returns false for a nullish transaction', () => { + expect(shouldShowTransactionPostedYear(undefined)).toBe(false); + expect(shouldShowTransactionPostedYear(null)).toBe(false); + }); +}); From 150d5bb0f1fbd06ca846077b52033d159f29cba6 Mon Sep 17 00:00:00 2001 From: Mukher Date: Wed, 8 Jul 2026 22:50:18 +0500 Subject: [PATCH 2/4] DRYed shouldShowTransactionPostedYear --- src/libs/SearchUIUtils.ts | 20 +++++++------------ .../shouldShowTransactionPostedYear.ts | 4 ++-- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/src/libs/SearchUIUtils.ts b/src/libs/SearchUIUtils.ts index d00c4e63e6ec..045850b54385 100644 --- a/src/libs/SearchUIUtils.ts +++ b/src/libs/SearchUIUtils.ts @@ -214,6 +214,7 @@ import { shouldShowAttendees as shouldShowAttendeesUtils, shouldShowViolation, } from './TransactionUtils'; +import shouldShowTransactionPostedYear from './TransactionUtils/shouldShowTransactionPostedYear'; import {isInvalidMerchantValue} from './ValidationUtils'; type ColumnSortMapping = Partial>; @@ -1523,11 +1524,9 @@ function shouldShowYear( result.shouldShowYearApproved = true; } - // Posted date is in the YYYYMMDD format, so we extract the year manually here since JS's Date constructor interprets it as an invalid date. // Latch once true so a later current-year date can't reset it (the row renderer latches the same way). - if (!result.shouldShowYearPosted && item?.posted) { - const postedYear = parseInt(item.posted.slice(0, 4), 10); - result.shouldShowYearPosted = postedYear !== currentYear; + if (!result.shouldShowYearPosted && shouldShowTransactionPostedYear(item, currentYear)) { + result.shouldShowYearPosted = true; } } @@ -1556,11 +1555,9 @@ function shouldShowYear( result.shouldShowYearApproved = true; } - // Posted date is in the YYYYMMDD format, so we extract the year manually here since JS's Date constructor interprets it as an invalid date. // Latch once true so a later current-year date can't reset it (the row renderer latches the same way). - if (!result.shouldShowYearPosted && item?.posted) { - const postedYear = parseInt(item.posted.slice(0, 4), 10); - result.shouldShowYearPosted = postedYear !== currentYear; + if (!result.shouldShowYearPosted && shouldShowTransactionPostedYear(item, currentYear)) { + result.shouldShowYearPosted = true; } const exportedAction = item.reportID ? lastExportedActionByReportID.get(item.reportID) : undefined; @@ -1917,11 +1914,8 @@ function processTransactionEntry(ctx: PreprocessingContext, transaction: OnyxTyp ctx.shouldShowYearApproved = true; } - if (!ctx.shouldShowYearPosted && transaction?.posted) { - const postedYear = parseInt(transaction.posted.slice(0, 4), 10); - if (postedYear !== ctx.currentYear) { - ctx.shouldShowYearPosted = true; - } + if (!ctx.shouldShowYearPosted && shouldShowTransactionPostedYear(transaction, ctx.currentYear)) { + ctx.shouldShowYearPosted = true; } // Optimistic: works when report-action keys precede transaction keys (common case). diff --git a/src/libs/TransactionUtils/shouldShowTransactionPostedYear.ts b/src/libs/TransactionUtils/shouldShowTransactionPostedYear.ts index 420275b23edf..31982728e73b 100644 --- a/src/libs/TransactionUtils/shouldShowTransactionPostedYear.ts +++ b/src/libs/TransactionUtils/shouldShowTransactionPostedYear.ts @@ -1,13 +1,13 @@ import type {OnyxInputOrEntry, Transaction} from '@src/types/onyx'; -function shouldShowTransactionPostedYear(transaction: OnyxInputOrEntry) { +function shouldShowTransactionPostedYear(transaction: OnyxInputOrEntry, currentYear: number = new Date().getFullYear()) { const posted = transaction?.posted; if (!posted) { return false; } // Posted date is in the YYYYMMDD format, so we read the year from the first 4 chars (the Date constructor treats YYYYMMDD as invalid). const postedYear = parseInt(String(posted).slice(0, 4), 10); - return postedYear !== new Date().getFullYear(); + return postedYear !== currentYear; } export default shouldShowTransactionPostedYear; From dfd4786e5aa4f0600b474450f3faf6c491e93ef1 Mon Sep 17 00:00:00 2001 From: Mukher Date: Sun, 12 Jul 2026 10:56:39 +0500 Subject: [PATCH 3/4] format posted date in report layout --- .../TransactionItemRowWide.tsx | 3 ++- src/libs/SearchUIUtils.ts | 4 ++-- .../getFormattedPostedDate.ts | 12 ++++++++++ tests/unit/getFormattedPostedDateTest.ts | 22 +++++++++++++++++++ 4 files changed, 38 insertions(+), 3 deletions(-) create mode 100644 src/libs/TransactionUtils/getFormattedPostedDate.ts create mode 100644 tests/unit/getFormattedPostedDateTest.ts diff --git a/src/components/TransactionItemRow/TransactionItemRowWide.tsx b/src/components/TransactionItemRow/TransactionItemRowWide.tsx index c4b8ab123a44..0773606c85d3 100644 --- a/src/components/TransactionItemRow/TransactionItemRowWide.tsx +++ b/src/components/TransactionItemRow/TransactionItemRowWide.tsx @@ -40,6 +40,7 @@ import { isScanning, isTimeRequest, } from '@libs/TransactionUtils'; +import getFormattedPostedDate from '@libs/TransactionUtils/getFormattedPostedDate'; import variables from '@styles/variables'; @@ -248,7 +249,7 @@ function TransactionItemRowWide({ style={[StyleUtils.getReportTableColumnStyles(CONST.SEARCH.TABLE_COLUMNS.POSTED, {isPostedColumnWide})]} > diff --git a/src/libs/SearchUIUtils.ts b/src/libs/SearchUIUtils.ts index 045850b54385..da34670c265f 100644 --- a/src/libs/SearchUIUtils.ts +++ b/src/libs/SearchUIUtils.ts @@ -214,6 +214,7 @@ import { shouldShowAttendees as shouldShowAttendeesUtils, shouldShowViolation, } from './TransactionUtils'; +import getFormattedPostedDate from './TransactionUtils/getFormattedPostedDate'; import shouldShowTransactionPostedYear from './TransactionUtils/shouldShowTransactionPostedYear'; import {isInvalidMerchantValue} from './ValidationUtils'; @@ -1214,8 +1215,7 @@ function getTransactionItemCommonFormattedProperties( const submitted = report?.submitted; const approved = report?.approved; - // Posted date is in the YYYYMMDD format, so we format it to YYYY-MM-DD here since JS's Date constructor interprets it as an invalid date. - const posted = !transactionItem?.posted ? '' : `${transactionItem?.posted.slice(0, 4)}-${transactionItem?.posted.slice(4, 6)}-${transactionItem?.posted.slice(6, 8)}`; + const posted = getFormattedPostedDate(transactionItem?.posted); return { formattedFrom, diff --git a/src/libs/TransactionUtils/getFormattedPostedDate.ts b/src/libs/TransactionUtils/getFormattedPostedDate.ts new file mode 100644 index 000000000000..5945ce60987f --- /dev/null +++ b/src/libs/TransactionUtils/getFormattedPostedDate.ts @@ -0,0 +1,12 @@ +/** Card posted dates are stored raw as `YYYYMMDD` (which `new Date()` treats as invalid); convert to `YYYY-MM-DD`. Already-ISO or empty values pass through. */ +function getFormattedPostedDate(posted?: string): string { + if (!posted) { + return ''; + } + if (!/^\d{8}$/.test(posted)) { + return posted; + } + return `${posted.slice(0, 4)}-${posted.slice(4, 6)}-${posted.slice(6, 8)}`; +} + +export default getFormattedPostedDate; diff --git a/tests/unit/getFormattedPostedDateTest.ts b/tests/unit/getFormattedPostedDateTest.ts new file mode 100644 index 000000000000..1323a35bef21 --- /dev/null +++ b/tests/unit/getFormattedPostedDateTest.ts @@ -0,0 +1,22 @@ +import getFormattedPostedDate from '@libs/TransactionUtils/getFormattedPostedDate'; + +describe('getFormattedPostedDate', () => { + it('converts a raw YYYYMMDD card posted date to YYYY-MM-DD', () => { + expect(getFormattedPostedDate('20260710')).toBe('2026-07-10'); + expect(getFormattedPostedDate('20251231')).toBe('2025-12-31'); + }); + + it('passes an already-ISO date through unchanged (idempotent)', () => { + expect(getFormattedPostedDate('2026-07-10')).toBe('2026-07-10'); + }); + + it('returns an empty string for empty/undefined input', () => { + expect(getFormattedPostedDate(undefined)).toBe(''); + expect(getFormattedPostedDate('')).toBe(''); + }); + + it('passes any non-YYYYMMDD string through unchanged', () => { + expect(getFormattedPostedDate('2026-7-1')).toBe('2026-7-1'); + expect(getFormattedPostedDate('not-a-date')).toBe('not-a-date'); + }); +}); From 96bd3a9a0cd5c9e3c98e42dd2e285b58b5215eaa Mon Sep 17 00:00:00 2001 From: Mukher Date: Wed, 15 Jul 2026 10:14:28 +0500 Subject: [PATCH 4/4] fix Posted truncation at year boundary by matching DateCell's year predicate --- src/libs/SearchUIUtils.ts | 10 ++++------ src/libs/TransactionUtils/getFormattedPostedDate.ts | 1 - .../shouldShowTransactionPostedYear.ts | 10 ++++++---- tests/unit/shouldShowTransactionPostedYearTest.ts | 8 ++++---- 4 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/libs/SearchUIUtils.ts b/src/libs/SearchUIUtils.ts index bc9e26d6f20c..bd3646f6ef5b 100644 --- a/src/libs/SearchUIUtils.ts +++ b/src/libs/SearchUIUtils.ts @@ -1525,7 +1525,7 @@ function shouldShowYear( } // Latch once true so a later current-year date can't reset it (the row renderer latches the same way). - if (!result.shouldShowYearPosted && shouldShowTransactionPostedYear(item, currentYear)) { + if (!result.shouldShowYearPosted && shouldShowTransactionPostedYear(item)) { result.shouldShowYearPosted = true; } } @@ -1556,7 +1556,7 @@ function shouldShowYear( } // Latch once true so a later current-year date can't reset it (the row renderer latches the same way). - if (!result.shouldShowYearPosted && shouldShowTransactionPostedYear(item, currentYear)) { + if (!result.shouldShowYearPosted && shouldShowTransactionPostedYear(item)) { result.shouldShowYearPosted = true; } @@ -1769,7 +1769,6 @@ type PreprocessingContext = { shouldShowAmountInWideColumn: boolean; shouldShowTaxAmountInWideColumn: boolean; hasDeletedTransaction: boolean; - currentYear: number; }; function createPreprocessingContext(): PreprocessingContext { @@ -1796,7 +1795,6 @@ function createPreprocessingContext(): PreprocessingContext { shouldShowAmountInWideColumn: false, shouldShowTaxAmountInWideColumn: false, hasDeletedTransaction: false, - currentYear: new Date().getFullYear(), }; } @@ -1914,7 +1912,7 @@ function processTransactionEntry(ctx: PreprocessingContext, transaction: OnyxTyp ctx.shouldShowYearApproved = true; } - if (!ctx.shouldShowYearPosted && shouldShowTransactionPostedYear(transaction, ctx.currentYear)) { + if (!ctx.shouldShowYearPosted && shouldShowTransactionPostedYear(transaction)) { ctx.shouldShowYearPosted = true; } @@ -1986,7 +1984,7 @@ function resolveExportedYearFlags(ctx: PreprocessingContext, data: OnyxTypes.Sea * (key classification, violations, export/action maps, year flags, column indicators) * needed by getTransactionsSections and getReportSections. */ -function classifyAndPreprocess(data: OnyxTypes.SearchResults['data']): Omit { +function classifyAndPreprocess(data: OnyxTypes.SearchResults['data']): Omit { const ctx = createPreprocessingContext(); for (const key of Object.keys(data)) { diff --git a/src/libs/TransactionUtils/getFormattedPostedDate.ts b/src/libs/TransactionUtils/getFormattedPostedDate.ts index 5945ce60987f..39622d896d75 100644 --- a/src/libs/TransactionUtils/getFormattedPostedDate.ts +++ b/src/libs/TransactionUtils/getFormattedPostedDate.ts @@ -1,4 +1,3 @@ -/** Card posted dates are stored raw as `YYYYMMDD` (which `new Date()` treats as invalid); convert to `YYYY-MM-DD`. Already-ISO or empty values pass through. */ function getFormattedPostedDate(posted?: string): string { if (!posted) { return ''; diff --git a/src/libs/TransactionUtils/shouldShowTransactionPostedYear.ts b/src/libs/TransactionUtils/shouldShowTransactionPostedYear.ts index 31982728e73b..a9b2ac7f15b8 100644 --- a/src/libs/TransactionUtils/shouldShowTransactionPostedYear.ts +++ b/src/libs/TransactionUtils/shouldShowTransactionPostedYear.ts @@ -1,13 +1,15 @@ +import DateUtils from '@libs/DateUtils'; + import type {OnyxInputOrEntry, Transaction} from '@src/types/onyx'; -function shouldShowTransactionPostedYear(transaction: OnyxInputOrEntry, currentYear: number = new Date().getFullYear()) { +import getFormattedPostedDate from './getFormattedPostedDate'; + +function shouldShowTransactionPostedYear(transaction: OnyxInputOrEntry) { const posted = transaction?.posted; if (!posted) { return false; } - // Posted date is in the YYYYMMDD format, so we read the year from the first 4 chars (the Date constructor treats YYYYMMDD as invalid). - const postedYear = parseInt(String(posted).slice(0, 4), 10); - return postedYear !== currentYear; + return DateUtils.doesDateBelongToAPastYear(getFormattedPostedDate(posted)); } export default shouldShowTransactionPostedYear; diff --git a/tests/unit/shouldShowTransactionPostedYearTest.ts b/tests/unit/shouldShowTransactionPostedYearTest.ts index e3b0e84bbdee..67c4349717d4 100644 --- a/tests/unit/shouldShowTransactionPostedYearTest.ts +++ b/tests/unit/shouldShowTransactionPostedYearTest.ts @@ -6,12 +6,12 @@ const currentYear = new Date().getFullYear(); const transactionWithPosted = (posted?: string) => ({...createRandomTransaction(0), posted}); describe('shouldShowTransactionPostedYear', () => { - it('returns true when the posted date is in a past year (YYYYMMDD)', () => { - expect(shouldShowTransactionPostedYear(transactionWithPosted(`${currentYear - 1}1231`))).toBe(true); + it('returns true when the raw YYYYMMDD posted date is in a past year', () => { + expect(shouldShowTransactionPostedYear(transactionWithPosted(`${currentYear - 1}0701`))).toBe(true); }); - it('returns false when the posted date is in the current year', () => { - expect(shouldShowTransactionPostedYear(transactionWithPosted(`${currentYear}0101`))).toBe(false); + it('returns false when the raw YYYYMMDD posted date is in the current year', () => { + expect(shouldShowTransactionPostedYear(transactionWithPosted(`${currentYear}0701`))).toBe(false); }); it('returns false when there is no posted date', () => {