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:
Ed Sanders 2022-10-10 14:50:02 +01:00
parent 66955ab733
commit 2c160ddb72

View file

@ -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' );
}
};