diff --git a/resources/src/mediawiki.widgets/mw.widgets.DateInputWidget.js b/resources/src/mediawiki.widgets/mw.widgets.DateInputWidget.js index f10c93db48c..9d2e93b8cf0 100644 --- a/resources/src/mediawiki.widgets/mw.widgets.DateInputWidget.js +++ b/resources/src/mediawiki.widgets/mw.widgets.DateInputWidget.js @@ -465,7 +465,8 @@ format = llll.replace( lll.replace( ll, '' ), '' ); if ( this.longDisplayFormat ) { - format = format.replace( 'MMM', 'MMMM' ).replace( 'ddd', 'dddd' ); + // Replace MMM to MMMM and ddd to dddd but don't change MMMM and dddd + format = format.replace( /MMMM?/, 'MMMM' ).replace( /dddd?/, 'dddd' ); } return format;