Javascript Date compare(targetDate)

Description

Javascript Date compare(targetDate)


Date.prototype.compare = function(targetDate){
  if(this.getTime() == targetDate.getTime()) return 0;
  var result = (this.getTime() > targetDate.getTime()) ? 1 : -1;
  return result;/* w w w .  ja  v a 2  s  .c  o  m*/
}



PreviousNext

Related