* 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. When not
* given, the default is language-specific.
* 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. When not
* given, the default is language-specific.
* @cfg {string} [placeholderLabel=No date selected] Placeholder text shown when the widget is not
* selected. Default text taken from message `mw-widgets-dateinput-no-date`.
* @cfg {string} [placeholderDateFormat] User-visible date format string displayed in the textual input
* @cfg {string} [placeholderLabel=No date selected] Placeholder text shown when the widget is not
* selected. Default text taken from message `mw-widgets-dateinput-no-date`.
* @cfg {string} [placeholderDateFormat] User-visible date format string displayed in the textual input
// Properties (must be set before parent constructor, which calls #setValue)
this.$handle = $( '<div>' );
// Properties (must be set before parent constructor, which calls #setValue)
this.$handle = $( '<div>' );
this.textInput = new OO.ui.TextInputWidget( {
required: config.required,
placeholder: placeholderDateFormat,
this.textInput = new OO.ui.TextInputWidget( {
required: config.required,
placeholder: placeholderDateFormat,
if ( config.mustBeAfter !== undefined ) {
mustBeAfter = moment( config.mustBeAfter, 'YYYY-MM-DD' );
if ( mustBeAfter.isValid() ) {
if ( config.mustBeAfter !== undefined ) {
mustBeAfter = moment( config.mustBeAfter, 'YYYY-MM-DD' );
if ( mustBeAfter.isValid() ) {
// Move 'tabindex' from this.$input (which is invisible) to the visible handle
this.setTabIndexedElement( this.$handle );
this.$handle
// Move 'tabindex' from this.$input (which is invisible) to the visible handle
this.setTabIndexedElement( this.$handle );
this.$handle
if ( this.getValue() === '' ) {
this.textInput.setValue( '' );
this.calendar.setDate( null );
if ( this.getValue() === '' ) {
this.textInput.setValue( '' );
this.calendar.setDate( null );
ll = localeData.longDateFormat( 'll' );
format = llll.replace( lll.replace( ll, '' ), '' );
ll = localeData.longDateFormat( 'll' );
format = llll.replace( lll.replace( ll, '' ), '' );
*/
mw.widgets.DateInputWidget.prototype.onClick = function ( e ) {
if ( !this.isDisabled() && e.which === 1 ) {
*/
mw.widgets.DateInputWidget.prototype.onClick = function ( e ) {
if ( !this.isDisabled() && e.which === 1 ) {
*/
mw.widgets.DateInputWidget.prototype.onCalendarKeyPress = function ( e ) {
if ( !this.isDisabled() && e.which === OO.ui.Keys.ENTER ) {
*/
mw.widgets.DateInputWidget.prototype.onCalendarKeyPress = function ( e ) {
if ( !this.isDisabled() && e.which === OO.ui.Keys.ENTER ) {