jquery - JavaScript Date() returns Invalid Date -


i working on website return time since date. when call new date() parameters user has inputted, returned "invalid date".

here code using: http://jsfiddle.net/8vkbu/ (the css looks bit weird in small window)

why returned "invalid date", , how can fix it?

thanks, fjpackard.

i update js fiddle

please check..

your code should following...

y = parseint($("#year").val()); m = parseint($("#month").val()) - 1; d = parseint($("#day").val()); h = parseint($("#hour").val()); 

instead of

y = parseint($("#years").val()); m = parseint($("#months").val()) - 1; d = parseint($("#days").val()); h = parseint($("#hours").val()); 

because input id in html form singular form

but in jquery use plural form

such in html use 'year' , in jquery use 'years'


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -