Angular Js Uib Bootstrap , How to combine Date & Time?

157 Views Asked by At

I am using angular uib -bootstrap date-picker & time-picker as separate input forms , and i need to combine the date and time on submit.

ctrl.time 
Fri May 26 2017 08:17:41 GMT+0530 (India Standard Time)

ctrl.date
Fri May 26 2017 16:17:41 GMT+0530 (India Standard Time)
1

There are 1 best solutions below

0
On

It looks like you are getting two date objects from either control.

If this is the case, try:

 var combineddate = new Date(ctrl.date.toDateString() + " " + ctrl.time.toTimeString())

Cheers!