| 1 |
<?php |
| 2 |
defined('ABSPATH') || die(); |
| 3 |
|
| 4 |
class HashFormFieldDate extends HashFormFieldType { |
| 5 |
|
| 6 |
protected $type = 'date'; |
| 7 |
|
| 8 |
protected function field_settings_for_type() { |
| 9 |
return array( |
| 10 |
'clear_on_focus' => true, |
| 11 |
'invalid' => true, |
| 12 |
); |
| 13 |
} |
| 14 |
|
| 15 |
protected function extra_field_default_opts() { |
| 16 |
return array( |
| 17 |
'format' => 'MM dd, yy' |
| 18 |
); |
| 19 |
} |
| 20 |
|
| 21 |
protected function input_html() { |
| 22 |
$field = $this->get_field(); |
| 23 |
?> |
| 24 |
<input type="text" data-format="<?php echo isset($field['date_format']) ? esc_attr($field['date_format']) : 'MM dd, yy'; ?>" <?php $this->field_attrs(); ?> autocomplete="off" /> |
| 25 |
<?php |
| 26 |
} |
| 27 |
|
| 28 |
} |
| 29 |
|