Javascript Date thisYear(date)

Description

Javascript Date thisYear(date)


Date.prototype.thisYear = function (date) {
    if (this != undefined && this.constructor == Date) {

        if (date == undefined) {
            date = new Date()//from  w ww .  j a va2 s .c om
        }

        if (this.getYear() == date.getYear()) {
            return true
        } else {
            return false
        }
    }
}



PreviousNext

Related