mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-15 04:13:47 +00:00
fix: excel parsing
This commit is contained in:
committed by
Carlos Valente
parent
ad46fac2d7
commit
dae6f84af0
@@ -1,4 +1,4 @@
|
||||
import { isTimeString } from './isTimeString';
|
||||
import { isISO8601, isTimeString } from './isTimeString';
|
||||
|
||||
describe('test isTimeString() function', () => {
|
||||
it('it validates time strings', () => {
|
||||
@@ -33,3 +33,16 @@ describe('test isTimeString() function handle AM/PM', () => {
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
describe('isISO8601()', () => {
|
||||
it('returns true for valid ISO 8601 date-time strings', () => {
|
||||
expect(isISO8601('1899-12-30T08:30:00.000Z')).toBe(true);
|
||||
expect(isISO8601('2022-01-01T00:00:00.000Z')).toBe(true);
|
||||
});
|
||||
|
||||
it('returns false for invalid ISO 8601 date-time strings', () => {
|
||||
expect(isISO8601('not a date')).toBe(false);
|
||||
expect(isISO8601('1899-12-30T08:30:00Z')).toBe(false); // missing milliseconds
|
||||
expect(isISO8601('1899-12-30 08:30:00.000Z')).toBe(false); // space instead of 'T'
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user