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

Node.js examples for Date:Year

Description

Judge the date is in same year as another date

Demo Code

    /**//from   w  w  w .j  av  a  2  s . c  om
     * Judge the date is in same year as another date
     * @param  {date}  date
     * @return {Boolean}
     */
    Date.prototype.isSameYear = function(date)
    {
        return this.getFullYear() === date.getFullYear();
    };
}());

Related Tutorials