mw.widgets.DateInputWidget: Don't set today's date on activation
authorBartosz Dziewoński <matma.rex@gmail.com>
Tue, 4 Aug 2015 12:00:02 +0000 (14:00 +0200)
committerBartosz Dziewoński <matma.rex@gmail.com>
Tue, 4 Aug 2015 12:00:02 +0000 (14:00 +0200)
Per Mark's review on Ia7bb737bc11b0af3659552fa75d11e6663e2812e.

Change-Id: Ie96602514dd57ffbe655d4ba4a8b5028771acda8

resources/src/mediawiki.widgets/mw.widgets.DateInputWidget.js

index 3888fc7..c20924b 100644 (file)
         * @private
         */
        mw.widgets.DateInputWidget.prototype.activate = function () {
-               if ( this.getValue() === '' ) {
-                       // Setting today's date is probably more helpful than leaving the widget empty? We could just
-                       // display the placeholder and leave it there, but it's likely that at least the year will be
-                       // the same as today's.
-
-                       // Use English locale to avoid number formatting
-                       this.setValue( moment().locale( 'en' ).format( this.getInternalFormat() ) );
-               }
-
                this.$element.addClass( 'mw-widget-dateInputWidget-active' );
                this.handle.toggle( false );
                this.textInput.toggle( true );