MediaWiki REL1_40
MediaWiki\Widget\DateInputWidget Class Reference

Date input widget. More...

Inherits OOUI\TextInputWidget.

Collaboration diagram for MediaWiki\Widget\DateInputWidget:

Public Member Functions

 __construct (array $config=[])
 
 getConfig (&$config)
 
 getInputElement ( $config)
 

Protected Member Functions

 getJavaScriptClassName ()
 

Protected Attributes

 $displayFormat = null
 
 $inputFormat = null
 
 $longDisplayFormat = null
 
 $mustBeAfter = null
 
 $mustBeBefore = null
 
 $placeholderDateFormat = null
 
 $placeholderLabel = null
 
 $precision = null
 

Detailed Description

Date input widget.

Since
1.29
Note
2016 MediaWiki Widgets Team and others; see AUTHORS.txt
MIT

Definition at line 14 of file DateInputWidget.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Widget\DateInputWidget::__construct ( array $config = [])
Parameters
array$configConfiguration options
  • string $config['inputFormat'] Date format string to use for the textual input field. Displayed while the widget is active, and the user can type in a date in this format. Should be short and easy to type. (default: 'YYYY-MM-DD' or 'YYYY-MM', depending on precision)
  • string $config['displayFormat'] Date format string to use for the clickable label. 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)
  • 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)
  • 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)
  • string $config['placeholderDateFormat'] User-visible date format string displayed in the textual input field when it's empty. Should be the same as inputFormat, but translated to the user's language. (default: 'YYYY-MM-DD' or 'YYYY-MM', depending on precision)
  • string $config['precision'] Date precision to use, 'day' or 'month' (default: 'day')
  • string $config['min'] Validates the date to be no earlier than this. In the 'YYYY-MM-DD' or 'YYYY-MM' format, depending on precision.
  • string $config['mustBeAfter'] Validates the date to be after this. Overrides 'min'. In the 'YYYY-MM-DD' or 'YYYY-MM' format, depending on precision.
  • string $config['max'] Validates the date to be no later than this. In the 'YYYY-MM-DD' or 'YYYY-MM' format, depending on precision.
  • string $config['mustBeBefore'] Validates the date to be before this. Overrides 'max'. In the 'YYYY-MM-DD' or 'YYYY-MM' format, depending on precision.

Definition at line 55 of file DateInputWidget.php.

References MediaWiki\Widget\DateInputWidget\$placeholderDateFormat, and wfMessage().

Member Function Documentation

◆ getConfig()

◆ getInputElement()

MediaWiki\Widget\DateInputWidget::getInputElement ( $config)

Definition at line 155 of file DateInputWidget.php.

◆ getJavaScriptClassName()

MediaWiki\Widget\DateInputWidget::getJavaScriptClassName ( )
protected

Definition at line 122 of file DateInputWidget.php.

Member Data Documentation

◆ $displayFormat

MediaWiki\Widget\DateInputWidget::$displayFormat = null
protected

Definition at line 17 of file DateInputWidget.php.

Referenced by MediaWiki\Widget\DateInputWidget\getConfig().

◆ $inputFormat

MediaWiki\Widget\DateInputWidget::$inputFormat = null
protected

Definition at line 16 of file DateInputWidget.php.

Referenced by MediaWiki\Widget\DateInputWidget\getConfig().

◆ $longDisplayFormat

MediaWiki\Widget\DateInputWidget::$longDisplayFormat = null
protected

Definition at line 18 of file DateInputWidget.php.

Referenced by MediaWiki\Widget\DateInputWidget\getConfig().

◆ $mustBeAfter

MediaWiki\Widget\DateInputWidget::$mustBeAfter = null
protected

Definition at line 22 of file DateInputWidget.php.

Referenced by MediaWiki\Widget\DateInputWidget\getConfig().

◆ $mustBeBefore

MediaWiki\Widget\DateInputWidget::$mustBeBefore = null
protected

Definition at line 23 of file DateInputWidget.php.

Referenced by MediaWiki\Widget\DateInputWidget\getConfig().

◆ $placeholderDateFormat

MediaWiki\Widget\DateInputWidget::$placeholderDateFormat = null
protected

◆ $placeholderLabel

MediaWiki\Widget\DateInputWidget::$placeholderLabel = null
protected

Definition at line 19 of file DateInputWidget.php.

Referenced by MediaWiki\Widget\DateInputWidget\getConfig().

◆ $precision

MediaWiki\Widget\DateInputWidget::$precision = null
protected

Definition at line 21 of file DateInputWidget.php.

Referenced by MediaWiki\Widget\DateInputWidget\getConfig().


The documentation for this class was generated from the following file: