Judge the date is same day as another date - Node.js Date

Node.js examples for Date:Date Calculation

Description

Judge the date is same day as another date

Demo Code


/**/*from w  ww .j a  va2s.  c  o m*/
 * Judge the date is same day as another date
 * @param  {date}  date
 * @return {Boolean}
 */
Date.prototype.isSameDay = function(date)
{
    return date.toDateString() === this.toDateString();
};

Related Tutorials