I know there are lots of questions similar to this, but all the examples I can find are asking how to get the absolute number of days difference.
How could I get the number of relative days between a date (epoch seconds) and the current time in Javascript e.g.
function getDaysDelta(secs) {
var hoursDelta = Math.ceil((secs - NOW_SECS) / 3600);
????
}
If it's 22:00 now and the supplied value is for 04:00 the following day, I would expect the function to return 1, because there is 1 day in the difference. Likewise, if it's 04:00 now, and the supplied value is for 22:00 the previous day, I would expect the function to return -1. It should return 0 if the supplied value falls sometime within today.
I would like to avoid pulling in a monster dependency, so pure JS is preferable, although I do already have a dependency on jQuery (v2), so solutions involving that are fine.