jenkins-bot has submitted this change and it was merged. Change subject: Special:TranslationStats: start using datetime-local format ......................................................................
Special:TranslationStats: start using datetime-local format This should help if we want to migrate to browser native datetime input which uses this format. Change-Id: I9185ffe9fa8e991c33c2f5910bfc2c79d9e63f48 --- M resources/js/ext.translate.special.translationstats.js M specials/SpecialTranslationStats.php 2 files changed, 4 insertions(+), 13 deletions(-) Approvals: Amire80: Looks good to me, approved jenkins-bot: Verified diff --git a/resources/js/ext.translate.special.translationstats.js b/resources/js/ext.translate.special.translationstats.js index 9440e5f..2e55304 100644 --- a/resources/js/ext.translate.special.translationstats.js +++ b/resources/js/ext.translate.special.translationstats.js @@ -14,23 +14,14 @@ // Based on UploadWizard, TranslationNotifications $( '#start' ) .datepicker( { - dateFormat: 'yymmdd', + dateFormat: 'yy-mm-ddT00:00:00', constrainInput: false, showOn: 'focus', changeMonth: true, changeYear: true, showAnim: false, showButtonPanel: true, - maxDate: new Date(), - onClose: function ( dateText, inst ) { - // TranslationStats works with the yyyymmddhhmmss format, - // so zeros that represents generic hh:mm:ss must be added. - // The zeros are added only if a date was actually selected - // and is not currently displayed. - if ( dateText !== '' && inst.input.val().length < 14 ) { - inst.input.val( dateText + '000000' ); - } - } + maxDate: new Date() } ) .attr( 'autocomplete', 'off' ); } ); diff --git a/specials/SpecialTranslationStats.php b/specials/SpecialTranslationStats.php index 6643f79..2eb7303 100644 --- a/specials/SpecialTranslationStats.php +++ b/specials/SpecialTranslationStats.php @@ -92,7 +92,7 @@ $opts->validateIntBounds( 'height', 200, 1000 ); if ( $opts['start'] !== '' ) { - $opts['start'] = (string)( wfTimestamp( TS_MW, $opts['start'] ) ); + $opts['start'] = rtrim( wfTimestamp( TS_ISO_8601, $opts['start'] ), 'Z' ); } $validScales = array( 'months', 'weeks', 'days', 'hours' ); @@ -166,7 +166,7 @@ $this->eInput( 'width', $opts ) . $this->eInput( 'height', $opts ) . '<tr><td colspan="2"><hr /></td></tr>' . - $this->eInput( 'start', $opts, 16 ) . // Should fit yyyymmddhhmmss + $this->eInput( 'start', $opts, 24 ) . $this->eInput( 'days', $opts ) . $this->eRadio( 'scale', $opts, array( 'months', 'weeks', 'days', 'hours' ) ) . $this->eRadio( 'count', $opts, $this->getGraphTypes() ) . -- To view, visit https://gerrit.wikimedia.org/r/310331 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9185ffe9fa8e991c33c2f5910bfc2c79d9e63f48 Gerrit-PatchSet: 3 Gerrit-Project: mediawiki/extensions/Translate Gerrit-Branch: master Gerrit-Owner: Nikerabbit <niklas.laxst...@gmail.com> Gerrit-Reviewer: Amire80 <amir.ahar...@mail.huji.ac.il> Gerrit-Reviewer: KartikMistry <kartik.mis...@gmail.com> Gerrit-Reviewer: Santhosh <santhosh.thottin...@gmail.com> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits