diff --git a/packages/time/src/tests/isValidDate.test.ts b/packages/time/src/tests/isValidDate.test.ts index 57a3556..01afdc6 100644 --- a/packages/time/src/tests/isValidDate.test.ts +++ b/packages/time/src/tests/isValidDate.test.ts @@ -4,7 +4,7 @@ import {isValidDate} from '../utils/isValidDate'; describe('isValidDate', () => { test('should return true for a valid date', () => { expect(isValidDate(new Date())).toBe(true); - }); + }) test('should return false for an invalid date', () => { expect(isValidDate(new Date("invalid"))).toBe(false); @@ -13,4 +13,4 @@ describe('isValidDate', () => { test("should return false for null", () => { expect(isValidDate(null)).toBe(false); }); -}); \ No newline at end of file +}); diff --git a/packages/time/src/tests/parse.test.ts b/packages/time/src/tests/parse.test.ts index 4ee0522..ededa27 100644 --- a/packages/time/src/tests/parse.test.ts +++ b/packages/time/src/tests/parse.test.ts @@ -102,11 +102,11 @@ describe('parse', () => { }); test('should throw an error for an invalid date string', () => { - expect(() => parse('2021-15-37')).toThrowError('"2021-15-37" is an invalid RFC339 Internet Date Time string'); + expect(() => parse('2021-15-37')).toThrowError('"2021-15-37" is an invalid RFC3339 Internet Date Time string'); }); test('should throw an error for an invalid time string', () => { - expect(() => parse('27:62')).toThrowError('"27:62" is an invalid RFC339 Internet Date Time string'); + expect(() => parse('27:62')).toThrowError('"27:62" is an invalid RFC3339 Internet Date Time string'); }); test('should throw an error for an invalid time string', () => { @@ -123,7 +123,7 @@ describe('parse', () => { }); test('should throw an error for an invalid date string', () => { - expect(() => parse('2021-01-01T00:00:00.000')).toThrowError('"2021-01-01T00:00:00.000" is an invalid RFC339 Internet Date Time string'); + expect(() => parse('2021-01-01T00:00:00.000')).toThrowError('"2021-01-01T00:00:00.000" is an invalid RFC3339 Internet Date Time string'); }); test('should throw an error for an invalid time string', () => { diff --git a/packages/time/src/utils/parse.ts b/packages/time/src/utils/parse.ts index 265021c..8d610f5 100644 --- a/packages/time/src/utils/parse.ts +++ b/packages/time/src/utils/parse.ts @@ -71,7 +71,7 @@ function parseDateTimeString(value: string): Date { `${year}-${month}-${day}T${hour}:${minute}:${second}.${millisecond}${timezone}`, ); } - throw new Error(`"${value}" is an invalid RFC339 Internet Date Time string`); + throw new Error(`"${value}" is an invalid RFC3339 Internet Date Time string`); } /**