Merge "Add parameter to API modules to apply change tags to log entries"
[lhc/web/wiklou.git] / includes / htmlform / fields / HTMLDateTimeField.php
index 5d4a15e..7b59a1d 100644 (file)
@@ -36,6 +36,11 @@ class HTMLDateTimeField extends HTMLTextField {
                        throw new InvalidArgumentException( "Invalid type '$this->mType'" );
                }
 
+               if ( $this->mPlaceholder === '' ) {
+                       // Messages: htmlform-date-placeholder htmlform-time-placeholder htmlform-datetime-placeholder
+                       $this->mPlaceholder = $this->msg( "htmlform-{$this->mType}-placeholder" )->text();
+               }
+
                $this->mClass .= ' mw-htmlform-datetime-field';
        }
 
@@ -43,31 +48,20 @@ class HTMLDateTimeField extends HTMLTextField {
                $parentList = array_diff( $list, [ 'min', 'max' ] );
                $ret = parent::getAttributes( $parentList );
 
-               if ( in_array( 'placeholder', $list ) && !isset( $ret['placeholder'] ) ) {
-                       // Messages: htmlform-date-placeholder htmlform-time-placeholder htmlform-datetime-placeholder
-                       $ret['placeholder'] = $this->msg( "htmlform-{$this->mType}-placeholder" )->text();
-               }
-
                if ( in_array( 'min', $list ) && isset( $this->mParams['min'] ) ) {
                        $min = $this->parseDate( $this->mParams['min'] );
                        if ( $min ) {
                                $ret['min'] = $this->formatDate( $min );
-                               // Because Html::expandAttributes filters it out
-                               $ret['data-min'] = $ret['min'];
                        }
                }
                if ( in_array( 'max', $list ) && isset( $this->mParams['max'] ) ) {
                        $max = $this->parseDate( $this->mParams['max'] );
                        if ( $max ) {
                                $ret['max'] = $this->formatDate( $max );
-                               // Because Html::expandAttributes filters it out
-                               $ret['data-max'] = $ret['max'];
                        }
                }
 
                $ret['step'] = 1;
-               // Because Html::expandAttributes filters it out
-               $ret['data-step'] = 1;
 
                $ret['type'] = $this->mType;
                $ret['pattern'] = static::$patterns[$this->mType];