21 'date' =>
'[0-9]{4}-[01][0-9]-[0-3][0-9]',
22 'time' =>
'[0-2][0-9]:[0-5][0-9]:[0-5][0-9](?:\.[0-9]+)?',
23 'datetime' =>
'[0-9]{4}-[01][0-9]-[0-3][0-9][T ][0-2][0-9]:[0-5][0-9]:[0-5][0-9](?:\.[0-9]+)?Z?',
35 if ( !
in_array( $this->mType, [
'date',
'time',
'datetime' ] ) ) {
36 throw new InvalidArgumentException(
"Invalid type '$this->mType'" );
39 if ( $this->mPlaceholder ===
'' ) {
41 $this->mPlaceholder = $this->
msg(
"htmlform-{$this->mType}-placeholder" )->text();
44 $this->mClass .=
' mw-htmlform-datetime-field';
48 $parentList =
array_diff( $list, [
'min',
'max' ] );
49 $ret = parent::getAttributes( $parentList );
51 if (
in_array(
'min', $list ) &&
isset( $this->mParams[
'min'] ) ) {
52 $min = $this->
parseDate( $this->mParams[
'min'] );
57 if (
in_array(
'max', $list ) &&
isset( $this->mParams[
'max'] ) ) {
58 $max = $this->
parseDate( $this->mParams[
'max'] );
73 if ( !
$request->getCheck( $this->mName ) ) {
83 $p = parent::validate(
$value, $alldata );
97 return $this->
msg(
"htmlform-{$this->mType}-invalid" );
100 if (
isset( $this->mParams[
'min'] ) ) {
101 $min = $this->
parseDate( $this->mParams[
'min'] );
102 if ( $min && $date < $min ) {
104 return $this->
msg(
"htmlform-{$this->mType}-toolow", $this->
formatDate( $min ) );
108 if (
isset( $this->mParams[
'max'] ) ) {
109 $max = $this->
parseDate( $this->mParams[
'max'] );
110 if ( $max && $date > $max ) {
112 return $this->
msg(
"htmlform-{$this->mType}-toohigh", $this->
formatDate( $max ) );
125 if ( $this->mType ===
'date' ) {
126 $value .=
' T00:00:00+0000';
128 if ( $this->mType ===
'time' ) {
133 $date =
new DateTime(
$value,
new DateTimeZone(
'GMT' ) );
134 return $date->getTimestamp();
135 }
catch ( Exception $ex ) {
141 switch ( $this->mType ) {
161 if (
isset( $this->mParams[
'min'] ) ) {
162 $min = $this->
parseDate( $this->mParams[
'min'] );
167 if (
isset( $this->mParams[
'max'] ) ) {
168 $max = $this->
parseDate( $this->mParams[
'max'] );
174 if ( $this->mType ===
'date' ) {
182 if ( $this->mType ===
'date' ) {
183 return [
'mediawiki.widgets.DateInputWidget' ];
185 return [
'mediawiki.widgets.datetime' ];
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
A field that will contain a date and/or time.
getOOUIModules()
Get the list of extra ResourceLoader modules which must be loaded client-side before it's possible to...
shouldInfuseOOUI()
Whether the field should be automatically infused.
validate( $value, $alldata)
Override this function to add specific validation checks on the field input.
loadDataFromRequest( $request)
Get the value that this input has been set to from a posted form, or the input's default value if it ...
getInputOOUI( $value)
Same as getInputHTML, but returns an OOUI object.
getAttributes(array $list)
Returns the given attributes from the parameters.
do that in ParserLimitReportFormat instead use this to modify the parameters of the image all existing parser cache entries will be invalid To avoid you ll need to handle that somehow(e.g. with the RejectParserCacheValue hook) because MediaWiki won 't do it for you. & $defaults also a ContextSource after deleting those rows but within the same transaction you ll probably need to make sure the header is varied on $request
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses & $ret
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))