Nikerabbit has uploaded a new change for review. https://gerrit.wikimedia.org/r/310331
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, 3 insertions(+), 12 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate refs/changes/31/310331/1 diff --git a/resources/js/ext.translate.special.translationstats.js b/resources/js/ext.translate.special.translationstats.js index 9440e5f..3c7a780 100644 --- a/resources/js/ext.translate.special.translationstats.js +++ b/resources/js/ext.translate.special.translationstats.js @@ -14,7 +14,7 @@ // Based on UploadWizard, TranslationNotifications $( '#start' ) .datepicker( { - dateFormat: 'yymmdd', + dateFormat: 'yy-mm-ddT00:00:00', constrainInput: false, showOn: 'focus', changeMonth: true, @@ -22,15 +22,6 @@ 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' ); - } - } } ) .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: newchange Gerrit-Change-Id: I9185ffe9fa8e991c33c2f5910bfc2c79d9e63f48 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Translate Gerrit-Branch: master Gerrit-Owner: Nikerabbit <niklas.laxst...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits