very quick question.
I have a datetime stored in my sql database. I am using this date to calculate the difference in time between those datetimes like the following:
var date1 = new Date(request[0].RequestDate.toString()); //coming from my db
var date2 = new Date(); // current datetime
var timeDiff = Math.abs(date2.getTime() - date1.getTime()); // calc diff
var rod= timeDiff / (1000 * 3600 * 24);
rod= rod.toFixed(2); // result that I want
However, this will give me the difference between those 2 dates including Sat and Sun.. How can I change my JS code to exclude Sat and Sun.
PS note: the day in the database that I am dealing with has, for example, the following format: Mon Dec 12 2016 10:23:50 GMT-0500 (Eastern Standard Time)
and I need the diff in "time" as you can notice in my JS code.
Thanks!