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

Contact Forms by Cimatti, version 2.3.6. 25 lines.

- Page: https://pluginprobe.com/plugins/contact-forms/2.3.6/code/classes/Element/Date.php
- Raw: https://pluginprobe.com/plugins/contact-forms/2.3.6/raw/classes/Element/Date.php
- Modified: 2026-08-05T09:37:24+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.3.6/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}';
    // 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);
  }
}

```
