[MediaWiki-commits] [Gerrit] mediawiki...Echo[master]: Round timestamps to the day when displaying date titles in S...

2016-08-05 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Round timestamps to the day when displaying date titles in 
Special:Notifications
..


Round timestamps to the day when displaying date titles in Special:Notifications

Bug: T141915
Change-Id: I5fcb78ac2fa168aa8bba90c467544fe3a6914ec3
---
M modules/ui/mw.echo.ui.DatedSubGroupListWidget.js
1 file changed, 5 insertions(+), 3 deletions(-)

Approvals:
  Catrope: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/ui/mw.echo.ui.DatedSubGroupListWidget.js 
b/modules/ui/mw.echo.ui.DatedSubGroupListWidget.js
index 24116fa..4e26b9f 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( '-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 ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/302748
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I5fcb78ac2fa168aa8bba90c467544fe3a6914ec3
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 
Gerrit-Reviewer: Catrope 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Echo[master]: Round timestamps to the day when displaying date titles in S...

2016-08-03 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/302748

Change subject: Round timestamps to the day when displaying date titles in 
Special:Notifications
..

Round timestamps to the day when displaying date titles in Special:Notifications

Bug: T141915
Change-Id: I5fcb78ac2fa168aa8bba90c467544fe3a6914ec3
---
M modules/ui/mw.echo.ui.DatedSubGroupListWidget.js
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo 
refs/changes/48/302748/1

diff --git a/modules/ui/mw.echo.ui.DatedSubGroupListWidget.js 
b/modules/ui/mw.echo.ui.DatedSubGroupListWidget.js
index 24116fa..e94190c 100644
--- a/modules/ui/mw.echo.ui.DatedSubGroupListWidget.js
+++ b/modules/ui/mw.echo.ui.DatedSubGroupListWidget.js
@@ -42,7 +42,9 @@
}
}, config ) );
 
-   momentTimestamp = moment.utc( this.model.getTimestamp() );
+   // Round all dates to the day they're in, as if they all
+   // happened at 00:00h
+   momentTimestamp = moment.utc( this.model.getTimestamp() 
).format( 'MMDD' );
diff = now.diff( momentTimestamp, 'weeks' );
fullDate = momentTimestamp.local().format( 'LL' );
 

-- 
To view, visit https://gerrit.wikimedia.org/r/302748
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5fcb78ac2fa168aa8bba90c467544fe3a6914ec3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits