* @copyright 2011-2015 MediaWiki Widgets Team and others; see AUTHORS.txt
* @license The MIT License (MIT); see LICENSE.txt
*/
-/*global moment */
+/* global moment */
( function ( $, mw ) {
/**
* calendar uses relative positioning.
*/
mw.widgets.DateInputWidget = function MWWDateInputWidget( config ) {
+ var placeholderDateFormat, mustBeAfter, mustBeBefore;
+
// Config initialization
config = $.extend( {
precision: 'day',
}
}
- var placeholderDateFormat, mustBeAfter, mustBeBefore;
if ( config.placeholderDateFormat ) {
placeholderDateFormat = config.placeholderDateFormat;
} else if ( config.inputFormat ) {
* @return {string} Format string
*/
mw.widgets.DateInputWidget.prototype.getDisplayFormat = function () {
+ var localeData, llll, lll, ll, format;
+
if ( this.displayFormat !== undefined ) {
return this.displayFormat;
}
// We try to construct it as 'llll - (lll - ll)' and hope for the best.
// This seems to work well for many languages (maybe even all?).
- var localeData = moment.localeData( moment.locale() ),
- llll = localeData.longDateFormat( 'llll' ),
- lll = localeData.longDateFormat( 'lll' ),
- ll = localeData.longDateFormat( 'll' ),
- format = llll.replace( lll.replace( ll, '' ), '' );
+ localeData = moment.localeData( moment.locale() );
+ llll = localeData.longDateFormat( 'llll' );
+ lll = localeData.longDateFormat( 'lll' );
+ ll = localeData.longDateFormat( 'll' );
+ format = llll.replace( lll.replace( ll, '' ), '' );
return format;
}