diff --git a/modules/ui/mw.echo.ui.DatedSubGroupListWidget.js b/modules/ui/mw.echo.ui.DatedSubGroupListWidget.js index 24116fa9a..4e26b9f1d 100644 --- a/modules/ui/mw.echo.ui.DatedSubGroupListWidget.js +++ b/modules/ui/mw.echo.ui.DatedSubGroupListWidget.js @@ -12,7 +12,7 @@ * @param {Object} [config] Configuration object */ mw.echo.ui.DatedSubGroupListWidget = function MwEchoUiDatedSubGroupListWidget( controller, listModel, config ) { - var momentTimestamp, diff, fullDate, + var momentTimestamp, diff, fullDate, stringTimestamp, now = moment(), $primaryDate = $( '' ) .addClass( 'mw-echo-ui-datedSubGroupListWidget-title-primary' ), @@ -42,9 +42,11 @@ } }, config ) ); - momentTimestamp = moment.utc( this.model.getTimestamp() ); + // Round all dates to the day they're in, as if they all happened at 00:00h + stringTimestamp = moment.utc( this.model.getTimestamp() ).local().format( 'YYYY-MM-DD' ); + momentTimestamp = moment( stringTimestamp ); diff = now.diff( momentTimestamp, 'weeks' ); - fullDate = momentTimestamp.local().format( 'LL' ); + fullDate = momentTimestamp.format( 'LL' ); $primaryDate.text( fullDate ); if ( diff === 0 ) {