/** * Check if object is empty * @param {Object} o * @return {boolean} **/ function isObjectEmpty(o) { for (var i in o) { if (o.hasOwnProperty(i)) { return false; } } return true; } /** * Check if these to ts are on the same day * @param {number} ts1 * @param {number} ts2 * @return {boolean} **/ function isSameDay(ts1, ts2) { var d1 = new Date(ts1), d2 = new Date(ts2); return d1.getDay() == d2.getDay() && d1.getMonth() == d2.getMonth() && d1.getYear() == d2.getYear(); }