diff --git a/lib/zin/wg/control/v1.php b/lib/zin/wg/control/v1.php index 177ee774e3..8abaf251f5 100644 --- a/lib/zin/wg/control/v1.php +++ b/lib/zin/wg/control/v1.php @@ -11,6 +11,7 @@ require_once dirname(__DIR__) . DS . 'radiolist' . DS . 'v1.php'; require_once dirname(__DIR__) . DS . 'select' . DS . 'v1.php'; require_once dirname(__DIR__) . DS . 'inputcontrol' . DS . 'v1.php'; require_once dirname(__DIR__) . DS . 'picker' . DS . 'v1.php'; +require_once dirname(__DIR__) . DS . 'datepicker' . DS . 'v1.php'; class control extends wg { @@ -121,6 +122,14 @@ class control extends wg ); } + protected function buildDate(): wg + { + return new datePicker + ( + set($this->props->skip('type')) + ); + } + protected function build(): wg { $type = $this->prop('type'); diff --git a/lib/zin/wg/datepicker/v1.php b/lib/zin/wg/datepicker/v1.php index ca3d49c54d..9e9904c018 100644 --- a/lib/zin/wg/datepicker/v1.php +++ b/lib/zin/wg/datepicker/v1.php @@ -3,9 +3,21 @@ namespace zin; require_once dirname(__DIR__) . DS . 'input' . DS . 'v1.php'; -class datePicker extends input +class datePicker extends wg { - static $defaultProps = array( - 'type' => 'date' - ); + /** + * Build the widget. + * + * @access protected + * @return wg + */ + protected function build(): wg + { + return zui::datePicker + ( + set::_class('form-group-wrapper'), + set::icon('calendar'), + set($this->props) + ); + } }