Skip to content

Commit aa2f031

Browse files
committed
Fix conversion error for short dates
1 parent 4753853 commit aa2f031

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/client/Omaha.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ export class Omaha extends EventEmitter<OmahaEvents> {
479479
}
480480

481481
if (key.endsWith('_at') || key === 'time' || key === 'date' || key.startsWith('date_')) {
482-
if (typeof value !== 'string' || !value.endsWith('Z')) {
482+
if (typeof value !== 'string' || (!value.endsWith('Z') && !/^\d{4}-\d{2}-\d{2}$/.test(value))) {
483483
throw new Error(`Error parsing field "${key}" in response as a date with value: ${value}`);
484484
}
485485

0 commit comments

Comments
 (0)