1 const TextParamMixin = require( './TextParamMixin.js' ),
2 UtilMixin = require( './UtilMixin.js' );
5 * A wrapper for mw.widgets.datetime.DateTimeInputWidget
10 * @param {Object} config Configuration options
12 function DateTimeParamWidget( config ) {
14 format: '${year|0}-${month|0}-${day|0}T${hour|0}:${minute|0}:${second|0}${zone|short}'
16 config.clearable = false;
18 DateTimeParamWidget.super.call( this, config );
21 OO.inheritClass( DateTimeParamWidget, mw.widgets.datetime.DateTimeInputWidget );
22 OO.mixinClass( DateTimeParamWidget, TextParamMixin );
23 OO.mixinClass( DateTimeParamWidget, UtilMixin );
26 * @return {jQuery.Promise}
28 DateTimeParamWidget.prototype.getValidity = function () {
29 if ( !this.apiBool( this.paramInfo.required ) || this.getApiValue() !== '' ) {
30 return $.Deferred().resolve().promise();
32 return $.Deferred().reject().promise();
36 module.exports = DateTimeParamWidget;