X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fwidget%2FDateInputWidget.php;h=507dab6fac9e00c5a51d21ca84f2c05523d0c1ce;hb=85c5bac952733c7a800dbe4e534dcaf120bf9fe5;hp=f011f0b8af4f0f57251f47df3d7cf96197a674fa;hpb=72b9240497311a2fa5f5b76d9e8bb953dc59853f;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/widget/DateInputWidget.php b/includes/widget/DateInputWidget.php index f011f0b8af..507dab6fac 100644 --- a/includes/widget/DateInputWidget.php +++ b/includes/widget/DateInputWidget.php @@ -19,6 +19,7 @@ class DateInputWidget extends \OOUI\TextInputWidget { protected $inputFormat = null; protected $displayFormat = null; + protected $longDisplayFormat = null; protected $placeholderLabel = null; protected $placeholderDateFormat = null; protected $precision = null; @@ -36,6 +37,9 @@ class DateInputWidget extends \OOUI\TextInputWidget { * while the widget is inactive. Should be as unambiguous as possible (for example, prefer * to spell out the month, rather than rely on the order), even if that makes it longer. * Applicable only if the widget is infused. (default: language-specific) + * @param string $config['longDisplayFormat'] If a custom displayFormat is not specified, use + * unabbreviated day of the week and month names in the default language-specific + * displayFormat. (default: false) * @param string $config['placeholderLabel'] Placeholder text shown when the widget is not * selected. Applicable only if the widget is infused. (default: taken from message * `mw-widgets-dateinput-no-date`) @@ -58,6 +62,7 @@ class DateInputWidget extends \OOUI\TextInputWidget { $config = array_merge( [ // Default config values 'precision' => 'day', + 'longDisplayFormat' => false, ], $config ); // Properties @@ -79,6 +84,9 @@ class DateInputWidget extends \OOUI\TextInputWidget { if ( isset( $config['displayFormat'] ) ) { $this->displayFormat = $config['displayFormat']; } + if ( isset( $config['longDisplayFormat'] ) ) { + $this->longDisplayFormat = $config['longDisplayFormat']; + } if ( isset( $config['placeholderLabel'] ) ) { $this->placeholderLabel = $config['placeholderLabel']; } @@ -134,6 +142,9 @@ class DateInputWidget extends \OOUI\TextInputWidget { if ( $this->displayFormat !== null ) { $config['displayFormat'] = $this->displayFormat; } + if ( $this->longDisplayFormat !== null ) { + $config['longDisplayFormat'] = $this->longDisplayFormat; + } if ( $this->placeholderLabel !== null ) { $config['placeholderLabel'] = $this->placeholderLabel; }