29 if ( !isset( $config[
'type'] ) ) {
30 throw new \InvalidArgumentException(
'$config[\'type\'] must be specified' );
32 $this->type = $config[
'type'];
34 parent::__construct( $config );
37 if ( isset( $config[
'min'] ) ) {
38 $this->min = $config[
'min'];
40 if ( isset( $config[
'max'] ) ) {
41 $this->max = $config[
'max'];
43 if ( isset( $config[
'clearable'] ) ) {
44 $this->clearable = $config[
'clearable'];
48 $this->addClasses( [
'mw-widgets-datetime-dateTimeInputWidget' ] );
52 return 'mw.widgets.datetime.DateTimeInputWidget';
57 if ( $this->min !==
null ) {
60 if ( $this->max !==
null ) {
63 if ( $this->clearable !==
null ) {
66 return parent::getConfig( $config );
70 return (
new Tag(
'input' ) )->setAttributes( [
'type' => $this->type ] );