Currently, I am utilizing the ionic datetime feature. However, instead of receiving just the hours, minutes, and seconds
, the result I am getting looks like this 2020-10-05T00:00:27.634+07:00
. What I actually require from this output is only 00:00:27
.
Is there a way to limit the output to my desired format?
Code
<ion-datetime display-format="HH:mm:ss" picker-format="HH:mm:ss" formControlName="quiz_time"></ion-datetime>
Note: The tag <ion-datetime>
is Ionic's default, and I have not made any additional modifications in the component for it to work. Therefore, what I specifically need assistance with is incorporating some functionality into my component to restrict the results of this input field. That's the support I'm seeking.
component
Transmission of data to the backend
quizCreate() {
const sems = this.quizData.value;
this.quizService.quizCreate(
sems.quiz_time, // my input (2020-10-05T00:00:27.634+07:00)
).subscribe(
(data: any) => {
console.log(data.message);
},
error => {
//
},
() => {
//
}
);
}
Any suggestions or solutions?