你需要
NgbTimeStruct
设置日期格式
ngb-timepicker
知道
import {Component} from '@angular/core';
import {NgbTimeStruct} from '@ng-bootstrap/ng-bootstrap';
@Component({
selector: 'schedule-form',
templateUrl: './schedule-form.component.html'
})
export class NgbdTimepickerBasic {
//declaration
time1: NgbTimeStruct;
time2: NgbTimeStruct;
ngOnInit() {
//get your start and end time and assign it to below
this.time1 = {hour: 13, minute: 30, second: 0};
this.time2 = {hour: 16, minute: 15, second: 0};
}
}