Determine whether today is a business weekday - Node.js Date

Node.js examples for Date:Day

Description

Determine whether today is a business weekday

Demo Code


/**/*from w  w  w.  j a  v a  2 s. co m*/
 * @description Determine whether today is a business weekday.
 * @param {Date} day: Day to test.
 * @returns {Boolean}
*/
isWeekday: function (day) {
  var dow = day.getDay(); // DayOfWeek
  return dow !== 0 && dow !== 6;
}

Related Tutorials