58
rated 0 times
[
62]
[
4]
/ answers: 1 / hits: 12965
/ 11 Years ago, tue, february 4, 2014, 12:00:00
I have two input tags for picking date and time from 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 a function where I want to combine these two input values as a Date
object:
new Date(y, m, d, hh, mm, a)
Which I can then use to plot an event's details in a Calendar. How can I combine these two values? I have 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 have tried is working.
How do I achieve this when using AngularJS?
More From » angularjs