Global.Date.prototype.equals (date, extend)
checks if a date object equals another date object

  • Parameter Object:
    Date object to compare
  • Parameter Int:
    indicating how far the comparison should go
  • Returns
    Boolean
Sourcecode in /home/hannes/helma/modules/core/Date.js:
156:   Date.prototype.equals = function(date, extend) {
157:       if (!extend)
158:           var extend = Date.ONEDAY;
159:       switch (extend) {
160:           case Date.ONESECOND:
161:               if (this.getSeconds() != date.getSeconds())
162:                   return false;
163:           case Date.ONEMINUTE:
164:               if (this.getMinutes() != date.getMinutes())
165:                  return false;
166:          case Date.ONEHOUR:
167:              if (this.getHours() != date.getHours())
168:                  return false;
169:          case Date.ONEDAY:
170:              if (this.getDate() != date.getDate())
171:                  return false;
172:          case Date.ONEMONTH:
173:              if (this.getMonth() != date.getMonth())
174:                  return false;
175:          case Date.ONEYEAR:
176:              if (this.getFullYear() != date.getFullYear())
177:                  return false;
178:      }
179:      return true;
180:  }