Browse Source

Merge pull request #19820 from abpframework/masum/ng-time-adapter

Fix return value when arg is not valid
pull/19821/head
sumeyye 2 years ago
committed by GitHub
parent
commit
aa1622e3ac
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 4
      npm/ng-packs/packages/theme-shared/src/lib/adapters/time.adapter.ts

4
npm/ng-packs/packages/theme-shared/src/lib/adapters/time.adapter.ts

@ -21,7 +21,9 @@ export class TimeAdapter extends NgbTimeAdapter<string | Date> {
}
toModel(value: NgbTimeStruct | null): string {
if (!value) return '';
if (!value) {
return null;
}
const date = new Date(0, 0, 1, value.hour, value.minute, value.second);
const formattedDate = formatDate(date, 'HH:mm:ss', 'en');

Loading…
Cancel
Save