mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-01 20:48:23 +08:00
Merge pull request #5309 from aignatov-bio/ai-sci-8325-fix-date-sorting-in-notifications
Fix date sorting in notifications [SCI-8325]
This commit is contained in:
commit
18590b502d
2 changed files with 3 additions and 4 deletions
|
@ -65,6 +65,7 @@ class UserNotificationsController < ApplicationController
|
|||
title: notification.title,
|
||||
message: notification.message,
|
||||
created_at: I18n.l(notification.created_at, format: :full),
|
||||
today: notification.created_at.today?,
|
||||
checked: notification.checked
|
||||
}
|
||||
end
|
||||
|
|
|
@ -75,12 +75,10 @@ export default {
|
|||
this.loadNotifications();
|
||||
},
|
||||
todayNotifications() {
|
||||
let startOfDay = (new Date()).setUTCHours(0, 0, 0, 0);
|
||||
return this.notifications.filter(n => moment(n.created_at) >= startOfDay);
|
||||
return this.notifications.filter(n => n.today);
|
||||
},
|
||||
olderNotifications() {
|
||||
let startOfDay = (new Date()).setUTCHours(0, 0, 0, 0);
|
||||
return this.notifications.filter(n => moment(n.created_at) < startOfDay);
|
||||
return this.notifications.filter(n => !n.today);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
|
Loading…
Reference in a new issue