var inputtime = this.getText(); var inputday = this.options.form.getWidgetByName("dtdDateEnd").getText(); var now = new Date(); var gettime = now.getHours(); var getday = now.getFullYear()+"-"+(now.getMonth()+1)+"-"+now.getDate(); if( inputtime > gettime && inputday == getday){ alert("超过当前时间"); return false; }; JS中获取的时间是2021-1-6,两个不对等;因为查询会用到20210106的数据,时间控件不能用yyyy-M-D这种格式,怎么才能让两端的数据作比较 |