Skip to content

Commit 397d884

Browse files
committed
Changed date/time format
1 parent 065738b commit 397d884

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/helpers/payment-helper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { format } from 'date-fns'
66
* @returns {string} Formatted date string (e.g., "26 January 2026 – 17:01:29")
77
*/
88
export function formatPaymentDate(isoString) {
9-
return format(new Date(isoString), 'd MMMM yyyy – HH:mm:ss')
9+
return format(new Date(isoString), 'd MMMM yyyy h:mmaaa')
1010
}
1111

1212
/**

src/helpers/payment-helper.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ describe('payment-helper', () => {
99
// The date part should always be correct
1010
expect(result).toContain('10 November 2025')
1111
// The time will vary by timezone, so just check format
12-
expect(result).toMatch(/10 November 2025 \d{2}:\d{2}:\d{2}/)
12+
expect(result).toMatch(/10 November 2025 \d{1,2}:\d{2}(am|pm)/)
1313
})
1414

1515
it('should handle different dates correctly', () => {
1616
const result = formatPaymentDate('2026-01-26T09:30:15.000Z')
1717

1818
expect(result).toContain('26 January 2026')
19-
expect(result).toMatch(/26 January 2026 \d{2}:\d{2}:\d{2}/)
19+
expect(result).toMatch(/26 January 2026 \d{1,2}:\d{2}(am|pm)/)
2020
})
2121
})
2222

0 commit comments

Comments
 (0)