diff --git a/changelog.txt b/changelog.txt index b2f9dcf3fa2ab2bff3a834c6f54d5fe2b5b245b2..c0cdfc743ba86d2c30904c25a2cb210f626ec552 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,9 @@ # Changelog + +## [2.4.11] - 2021-12-03 +### Added +- Added date input field + ## [2.4.10] - 2021-10-01 ### Changed - Render form data without using echo diff --git a/src/Field/DateField.php b/src/Field/DateField.php new file mode 100644 index 0000000000000000000000000000000000000000..b5c11f7d84480906339b52595e4fd388c11d5ae5 --- /dev/null +++ b/src/Field/DateField.php @@ -0,0 +1,22 @@ +<?php + +namespace WPDesk\Forms\Field; + +use WPDesk\Forms\Sanitizer\TextFieldSanitizer; + +class DateField extends BasicField { + + public function __construct() { + parent::__construct(); + $this->set_placeholder('YYYY-MM-DD'); + } + + public function get_type() { + return 'date'; + } + + public function get_template_name() { + return 'input-text'; + } + +}