MediaWiki  1.30.0
MediaWiki\Widget\DateInputWidget Class Reference

Date input widget. More...

Inheritance diagram for MediaWiki\Widget\DateInputWidget:
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
 
 $overlay = null
 
 $placeholderDateFormat = null
 
 $placeholderLabel = null
 
 $precision = null
 

Detailed Description

Date input widget.

Since
1.29

Definition at line 18 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,['mustBeAfter']Validates the date to be after this. In the 'YYYY-MM-DD' or 'YYYY-MM' format, depending on precision.
string$config,['mustBeBefore']Validates the date to be before this. In the 'YYYY-MM-DD' or 'YYYY-MM' format, depending on precision.
string$config,['overlay']The jQuery selector for the overlay layer on which to render the calendar. This configuration is useful in cases where the expanded calendar is larger than its container. The specified overlay layer is usually on top of the container and has a larger area. Applicable only if the widget is infused. By default, the calendar uses relative positioning.

Definition at line 61 of file DateInputWidget.php.

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

Member Function Documentation

◆ getConfig()

◆ getInputElement()

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

Definition at line 169 of file DateInputWidget.php.

References MediaWiki\$config.

◆ getJavaScriptClassName()

MediaWiki\Widget\DateInputWidget::getJavaScriptClassName ( )
protected

Definition at line 134 of file DateInputWidget.php.

Member Data Documentation

◆ $displayFormat

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

Definition at line 21 of file DateInputWidget.php.

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

◆ $inputFormat

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

Definition at line 20 of file DateInputWidget.php.

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

◆ $longDisplayFormat

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

Definition at line 22 of file DateInputWidget.php.

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

◆ $mustBeAfter

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

Definition at line 26 of file DateInputWidget.php.

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

◆ $mustBeBefore

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

Definition at line 27 of file DateInputWidget.php.

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

◆ $overlay

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

Definition at line 28 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 23 of file DateInputWidget.php.

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

◆ $precision

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

Definition at line 25 of file DateInputWidget.php.

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


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