will be helpful for those in need I'm trying to add a time to a date in my Angular application. , You can convert selected time to minutes like below
var appointmentTimeItems = appointmentTime.split(":");
var hoursPart = parseInt(appointmentTimeItems);
var minutesPart = parseInt(appointmentTimeItems);
var minutes = (hoursPart * 60) + minutesPart;
seems to work fine You have filled out the name field of the element, but it lacks the id needed to find it via getElementById. Also, .text won't do anything, you need to set its value attribute. Since your input has a limit of 10 characters you might try removing that to show the full date string or you could instead simply write to the table cell with innerHTML or some such method.
hope this fix your issue There are many problems here. You actually never make any use of dateFormatter other than creating and then never using convertedDate. So delete that unused code. You have indicated at duration should be in minutes but you treat it as seconds. You need to multiply by 60 to convert it to minutes. All of your code for calculating things such as openingTimeQueryEnd depend on each value being two digits but your code doesn't give the desired results.