# contact-forms/2.2.4/classes/Element/Date.php

Contact Forms by Cimatti, version 2.2.4. 18 lines.

- Page: https://pluginprobe.com/plugins/contact-forms/2.2.4/code/classes/Element/Date.php
- Raw: https://pluginprobe.com/plugins/contact-forms/2.2.4/raw/classes/Element/Date.php
- Modified: 2026-04-08T09:49:58+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/contact-forms/2.2.4/code/classes/Element/Date.php#L10-L20`.

```php
<?php
class AccuaForm_Element_Date extends Element_Textbox {
  protected $minDate = null;
  protected $maxDate = null;
  public function __construct($label, $name, array $properties = null) {
    parent::__construct($label,$name,$properties);
    $this->attributes['type'] = 'date';
    $this->attributes['pattern'] = '\d{4}-\d{2}-\d{2}';
    // 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);
  }
}

```
