views:

76

answers:

1

Anyone know why this doesn't work?

var lastReceivedBeginDate = new Date($("input[name='lastReceivedFromYear']").val(),$("input[name='lastReceivedFromMonth']").val(),$("input[name='lastReceivedFromDay']").val(),$("input[name='lastReceivedFromHour']").val(),$("input[name='lastReceivedFromMinute']").val(),$("input[name='lastReceivedFromSecond']").val());  

Thx

A: 

My first guess would be that you are missing the milliseconds parameter in the Date constructor. From here, the constructor you are trying to use is

new Date(year, month, day, hours, minutes, seconds, milliseconds)

If that's not it, what error are you getting? Are the values returned from .val() what you expect?

rosscj2533
hours, minutes, seconds and milliseconds are optional arguments in the `Date` constructor.
Andy E
@Andy, you're absolutely right, thanks for pointing that out. I'd say we'd need more info to help then...
rosscj2533