25 parent::__construct( $params );
27 $type = !empty( $params[
'options'] ) ?
'selectorother' :
'text';
37 return $this->relativeField->getInputHTML( $value );
50 'mediawiki.widgets.expiry',
52 $this->relativeField->getOOUIModules()
61 $this->relativeField->getInputOOUI( $value ),
64 'required' => $this->mParams[
'required'] ??
false,
73 return $this->relativeField->loadDataFromRequest( $request );
83 $class = HTMLForm::$typeMappings[
$type];
85 $params[
'type'] =
$type;
86 $params[
'class'] = $class;
89 unset( $params[
'label-message'] );
90 return new $class( $params );
Expiry Field that allows the user to specify a precise date or a relative date string.
shouldInfuseOOUI()
Whether the field should be automatically infused.
__construct(array $params=[])
Relative Date Time Field.
getInputOOUI( $value)
Same as getInputHTML, but returns an OOUI object.Defaults to false, which getOOUI will interpret as "...
HTMLFormField $relativeField
getInputHTML( $value)
This function must be implemented to return the HTML to generate the input object itself....
getFieldByType( $type)
Get the HTMLForm field by the type string.
getOOUIModules()
Get the list of extra ResourceLoader modules which must be loaded client-side before it's possible to...
loadDataFromRequest( $request)
Get the value that this input has been set to from a posted form, or the input's default value if it ...