import { formatEventDateTime } from '../date' describe('formatEventDateTime', () => { beforeEach(() => { jest.useFakeTimers({ now: new Date(2026, 5, 15, 12, 0) }) }) afterEach(() => { jest.useRealTimers() }) it('leaves out the year for dates in the current year', () => { expect(formatEventDateTime(new Date(2026, 1, 3, 14, 18))).toBe('Feb 3 at 2:18pm') }) it('includes the year for dates in other years', () => { expect(formatEventDateTime(new Date(2025, 1, 3, 14, 18))).toBe('Feb 3, 2025 at 2:18pm') }) it('drops the minutes on the hour', () => { expect(formatEventDateTime(new Date(2026, 1, 3, 14, 0))).toBe('Feb 3 at 2pm') }) })