I really need your help to finish this
I'm working on my own script which import date from input which look like this:
<input type='text' class='hidden' value='$a' id='test'>
$a is date, taken from db with template(?): 2014, 03, 09, 04, 07, 02
And its: Year, Month, Day, Hour, Minute, Second
So it looks like this
<input type='text' class='hidden' value='2014, 03, 09, 04, 07, 02' id='test'>
My javascript file is like this:
$(function() {
$('input#test').removeClass('hidden');
var a = $('input#test').val();
console.log(a);
var b = +new Date(a);
console.log(b);
The 1st console log returns what input has (2014, 03, 09, 04, 07, 02), but the 2nd one returns NaN. I have no idea why :c
When I write it manually like this:
var b = +new Date(2014, 03, 09, 04, 07, 02);
Its all working.. I have no idea how to solve it, I've also tried using this:
- span and .html();
- span and .text();
Any ideas? :)