1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-19 13:29:41 +02:00
portainer/app/setup-tests/mock-localizeDate.ts
Ali 4ee349bd6b feat(helm): helm actions [r8s-259] (#715)
Co-authored-by: James Player <james.player@portainer.io>
Co-authored-by: Cara Ryan <cara.ryan@portainer.io>
Co-authored-by: stevensbkang <skan070@gmail.com>
2025-05-13 22:15:04 +12:00

18 lines
481 B
TypeScript

export function mockLocalizeDate() {
// Mock localizeDate to always use en-US and UTC
vi.mock('@/react/common/date-utils', () => ({
localizeDate: (date: Date) =>
date
.toLocaleString('en-US', {
timeZone: 'UTC',
year: 'numeric',
month: 'short',
day: 'numeric',
hour: 'numeric',
minute: '2-digit',
hour12: true,
})
.replace('am', 'AM')
.replace('pm', 'PM'),
}));
}