I have two input tags for selecting date and time from the user.
<p>Start Date</p><p> <input ng-model="sdate" type="date" ></p>
<p>Start Time</p><p> <input ng-model="stime" type="time" ></p>
These two values ββare passed to the function where I want to combine these two input values ββas an object Date:
new Date(y, m, d, hh, mm, a)
Then I can use to create event details in the calendar. How can I combine these two values? I tried:
start:new Date(sdate + stime)
start:new Date(sdate , stime)
start: new Date(sdate.getFullYear() + sdate.getMonth() + sdate.getDate() + stime.getHours + stime.getMinutes())
But none of what I tried works.
How to achieve this when using AngularJS?
source
share