Here my below code:
var date = new Date().toLocaleString();
console.log(date); // output: 2018-01-15 16:39:00
var schedule = 2018-01-15 16:39:00 (which is coming from my html form, i putting this date in one input box and getting into variable called schedule).
console.log(schedule); // output: 2018-01-15 16:39:00
if(date === schedule) {
console.log('date is matched');
} else {
console.log('error');
}
This will show correctly as output: // 'date is matched' (I am typing this date in input box without any date picker).
My problem is if i do this same code using date picker instead of writing date in input box.
My code:
var date = new Date().toLocaleString();
console.log(date); // output: 2018-01-15 16:39:00
var schedule = 2018-01-15 16:39:00 (which is coming from my html form,using date picker).
console.log(schedule); // output: 2018-01-15 16:39:00
if(date === schedule) {
console.log('date is matched');
} else {
console.log('error');
}
Now i am getting error in console. Date picker which i am using https://www.npmjs.com/package/angularjs-datetime-picker