I am currently working on modifying ngb-timepicker so that it returns a string instead of an object. Right now, it is returning the following format:
{
"hour": 13,
"minute": 30
}
However, I want it to return in this format:
"13:30"
This is the HTML code I have used:
<div class="calendar"> <ngb-datepicker #dp
[(ngModel)]="model"></ngb-datepicker>
<ngb-timepicker [(ngModel)]="time"></ngb-timepicker>
For the datepicker, I was able to convert the object into a string using the following method:
constructor(private dateFormatter: NgbDateParserFormatter) {
const string_date = this.dateFormatter.format(this.model);
}
Is there a similar NgbDateParserFormatter function that can be used for time?