Skip to content

Commit

Permalink
Fix Invalid DateTime
Browse files Browse the repository at this point in the history
The default numbering system "latn" used to parse the time in locale string returns a Narrow No-Break Space (NNBSP) instead of standard space which cause the parse to fail. The proposed fix replace the NNBSP for a standard space.
  • Loading branch information
wratte committed Feb 12, 2023
1 parent 73979e1 commit e0ab9a6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/material-timepicker/services/time-adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ export class TimeAdapter {
...DateTime.TIME_SIMPLE,
hour12: format !== 24,
numberingSystem: TimeAdapter.DEFAULT_NUMBERING_SYSTEM
}).replace(/\u200E/g, '');
}).replace(/\u200E/g, '').replace(' ', ' ');
}
return parsedTime.toISOTime({
includeOffset: false,
suppressMilliseconds: true,
suppressSeconds: true
}).replace(/\u200E/g, '');
}).replace(/\u200E/g, '').replace(' ', ' ');
}

static toLocaleTimeString(time: string, opts: TimeOptions = {}): string {
Expand Down

0 comments on commit e0ab9a6

Please sign in to comment.