protected void validateDate ( String field , Date min , Date max , String errorKey , String errorMessage ) { String value = controller . getPara ( field ) ; if ( StrKit . isBlank ( value ) ) { addError ( errorKey , errorMessage ) ; return ; } try { Date temp = new SimpleDateFormat ( getDatePattern ( ) ) . parse ( value . trim ( ) ) ; // Date temp = Date.valueOf(value); 为了兼容 64位 JDK if ( temp . before ( min ) || temp . after ( max ) ) { addError ( errorKey , errorMessage ) ; } } catch ( Exception e ) { addError ( errorKey , errorMessage ) ; } }
Validate date .