attributes['type'] = 'date'; $this->attributes['pattern'] = '\d{4}-\d{2}-\d{2}'; // Extract minDate and maxDate from properties if present if ($properties && isset($properties['minDate'])) { $this->minDate = $properties['minDate']; } if ($properties && isset($properties['maxDate'])) { $this->maxDate = $properties['maxDate']; } // translators: %element% is the field label. $date_error_msg = __( "Attention: '%element%' must contain a valid date.", 'contact-forms' ); $validator = new AccuaForm_Validation_Date( str_replace( '%element%', $label, $date_error_msg ) ); $validator->configure(array('minDate' => $this->minDate, 'maxDate'=> $this->maxDate)); $this->setValidation($validator); } }