r99553 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99552‎ | r99553 | r99554 >
Date:20:03, 11 October 2011
Author:jpostlethwaite
Status:deferred (Comments)
Tags:
Comment:
Fixed a bad variable name. Removed UTC code.
Modified paths:
  • /trunk/extensions/LastModified/modules/lastmodified.js (modified) (history)

Diff [purge]

Index: trunk/extensions/LastModified/modules/lastmodified.js
@@ -34,7 +34,7 @@
3535
3636 // Get the current timestamp and remove the milliseconds
3737 var nowStamp = extensionsLastModifiedGetUtcTimeStamp();
38 - //console.log( 'nowStamp: ' + nowStamp );
 38+ console.log( 'nowStamp: ' + nowStamp );
3939
4040 // Get the difference in the time from when it was last edited.
4141 var modifiedDifference = nowStamp - lastEdited;
@@ -50,30 +50,15 @@
5151 /**
5252 * Get the UTC Timestamp without microseconds
5353 *
54 - * @todo
55 - * - What do we need to do about timezones?
56 - *
5754 * @return integer
5855 */
5956 function extensionsLastModifiedGetUtcTimeStamp() {
6057
6158 // Get the current Date object
6259 var now = new Date();
63 - //console.log( 'now: ' + now );
 60+ console.log( 'now: ' + now );
6461
6562 return parseInt( now.getTime() / 1000 );
66 -
67 - // Return the UTC timestamp
68 - return parseInt(
69 - Date.UTC(
70 - now.getUTCFullYear(),
71 - now.getUTCMonth(),
72 - now.getUTCDay(),
73 - now.getUTCHours(),
74 - now.getUTCMinutes(),
75 - now.getUTCSeconds()
76 - ) / 1000
77 - );
7863 }
7964
8065 /**
@@ -140,12 +125,12 @@
141126
142127 // Message to return
143128 var message = '';
144 - var lastEdit = modifiedDifference;
 129+ var myLastEdit = modifiedDifference;
145130
146131 if ( modifiedDifference < 60 ) {
147132
148133 // seconds
149 - message = ( mw.msg( 'lastmodified-seconds', lastEdit ) );
 134+ message = ( mw.msg( 'lastmodified-seconds', myLastEdit ) );
150135
151136 }
152137 else if ( modifiedDifference < 3600 ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r99554Disabled console debugging.jpostlethwaite20:06, 11 October 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r99522Adding new extension LastModified.jpostlethwaite18:30, 11 October 2011

Comments

#Comment by Jpostlethwaite (talk | contribs)   20:06, 11 October 2011

Had to remove console debugging

Status & tagging log