0

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)
Haris KK
  • 267
  • 1
  • 4
  • 14

1 Answers1

0

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!

Stack
  • 348
  • 3
  • 17