mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-09-23 10:29:11 +00:00
CommentItem.js: Ensure timestamps are UTC
This will not be the case if we do a full parse in the client on a non-UTC site. Change-Id: I226c4f580e60114992bfc06896ef4868e6ea9124
This commit is contained in:
parent
66955ab733
commit
2c160ddb72
|
@ -50,10 +50,10 @@ CommentItem.prototype.getTimestampString = function () {
|
|||
var dtConfig = require( './config.json' );
|
||||
var switchTime = moment.utc( dtConfig.switchTime );
|
||||
if ( this.timestamp < switchTime ) {
|
||||
return this.timestamp.toISOString();
|
||||
return this.timestamp.utc().toISOString();
|
||||
} else {
|
||||
// Switch to English locale to avoid number formatting
|
||||
return this.timestamp.locale( 'en' ).format( 'YYYYMMDDHHmmss' );
|
||||
return this.timestamp.utc().locale( 'en' ).format( 'YYYYMMDDHHmmss' );
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue