js 判断是否是今天

2018-06-01  本文已影响0人  OK2018
let isToday=(signDate,curDate)=>{

  // let curDate = moment().format('YYYY-MM-DD');
  if(!isEmpty(signDate)){

    let {curYear,curMonth,curDay} = curDate.split('-');
    let {signYear,signMonth,signDay} = signDate.split('-');

    if(signYear<curYear){
      return true;
    }else{
      if(signMonth<curMonth){
        return true;
      }else{
        if(signDay<curDay){
          return true;
        }else{return false;
        }
      }
    }
  }else{
    return true;
  }

}
上一篇下一篇

猜你喜欢

热点阅读