r84149 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84148‎ | r84149 | r84150 >
Date:05:23, 17 March 2011
Author:neilk
Status:deferred
Tags:
Comment:
simplify error conditions
Modified paths:
  • /trunk/extensions/UploadWizard/resources/mw.UtilitiesTime.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UploadWizard/resources/mw.UtilitiesTime.js
@@ -15,8 +15,7 @@
1616 */
1717 mw.seconds2npt = function( sec, show_ms ) {
1818 if ( isNaN( sec ) ) {
19 - mw.log("mw.seconds2npt> Warning: trying to get npt time on NaN:" + sec);
20 - return '0:00:00';
 19+ sec = 0;
2120 }
2221
2322 var tm = mw.seconds2Measurements( sec );
@@ -66,8 +65,7 @@
6766 */
6867 mw.npt2seconds = function ( npt_str ) {
6968 if ( !npt_str ) {
70 - // mw.log('npt2seconds:not valid ntp:'+ntp);
71 - return false;
 69+ return undefined;
7270 }
7371 // Strip {npt:}01:02:20 or 32{s} from time if present
7472 npt_str = npt_str.replace( /npt:|s/g, '' );

Status & tagging log