Is form date input before now - Node.js HTML

Node.js examples for HTML:Form

Description

Is form date input before now

Demo Code

function isBeforeNow(inputDay, inputHour, inputMinute) {
  if(inputDay==null || inputDay==''){
        return false;
  }/*w  ww.j  a va2  s  . c  om*/
  var now = new Date();
  var date=new Date();
  var myDate_array=inputDay.split("/");
  date.setFullYear(myDate_array[0], myDate_array[1]-1, myDate_array[2]);
  if (!(inputHour==null || inputHour =='')) date.setHours(inputHour);
  if (!(inputMinute==null || inputMinute =='')) date.setMinutes(inputMinute);
  date.setSeconds(59.999);
    if (now < date){
      return false;
    }  
  else return true;  
}

Related Tutorials