I', trying to get the difference (in days) between two dates generated by the jquery ui datepicker plugin, this is how i am trying (based on this acepted answer)
var sDate = $('.start input').datepicker('getDate');
var nDate = $('.end input').datepicker('getDate');
console.log(sDate); /* Logs Date {Wed Oct 16 2013 00:00:00 GMT+0200 (CEST)} */
console.log(nDate); /* Logs Date {Fri Oct 18 2013 00:00:00 GMT+0200 (CEST)} */
var dias = (nDate - sDate)/1000/60/60/24;
console.log(dias); /* Logs 30 */
Problem is that I selected two dates with 2 days of difference and this is loging 30,
what am I missing here?