forked from wangziqi/gongxue-base
fix permissions and teacher attendance workflows
This commit is contained in:
15
apps/server/src/database/date-normalization.spec.ts
Normal file
15
apps/server/src/database/date-normalization.spec.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { normalizeDateOnly } from './date-normalization';
|
||||
|
||||
describe('normalizeDateOnly', () => {
|
||||
it('keeps date-only values unchanged', () => {
|
||||
expect(normalizeDateOnly('2026-07-02')).toBe('2026-07-02');
|
||||
});
|
||||
|
||||
it('converts legacy ISO timestamps to their UTC calendar date', () => {
|
||||
expect(normalizeDateOnly('2026-07-01T16:00:00.000Z')).toBe('2026-07-01');
|
||||
});
|
||||
|
||||
it('rejects unsupported date formats', () => {
|
||||
expect(() => normalizeDateOnly('07/01/2026')).toThrow('无效日期格式');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user