Skip to content

Commit 275510f

Browse files
committed
fix datetime format for RFC3339 compliance
1 parent 4ca86d2 commit 275510f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/formats.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export const fastFormats: DefinedFormats = {
102102
compareTime
103103
),
104104
"date-time": fmtDef(
105-
/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,
105+
/^\d\d\d\d-[0-1]\d-[0-3]\d[tT](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:[zZ]|[+-][0-2]\d:[0-5]\d)$/,
106106
compareDateTime
107107
),
108108
"iso-time": fmtDef(
@@ -197,7 +197,7 @@ function compareIsoTime(t1: string, t2: string): number | undefined {
197197
return 0
198198
}
199199

200-
const DATE_TIME_SEPARATOR = /t|\s/i
200+
const DATE_TIME_SEPARATOR = /t|T/i
201201
function getDateTime(strictTimeZone?: boolean): (str: string) => boolean {
202202
const time = getTime(strictTimeZone)
203203

0 commit comments

Comments
 (0)