-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Display dashboard actions in correct order #879
Conversation
PR 879 with branch
|
@@ -138,5 +138,5 @@ export const getActions = async ( | |||
await Promise.all([articles, pages, comments, authors, subscriptions, polls, users, events]) | |||
).flat() | |||
|
|||
return actions.sort((v1: Action, v2: Action) => v2.date.getDate() - v1.date.getDate()) | |||
return actions.sort((v1: Action, v2: Action) => v2.date.getTime() - v1.date.getTime()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return actions.sort((v1: Action, v2: Action) => v2.date.getTime() - v1.date.getTime()) | |
return actions.sort((v1: Action, v2: Action) => v2.date - v1.date) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Itrulia the sort won't work with Date type so I needed it as a number.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually you're right it should work, but ts shows error.
WPC-1118: Dashboard action were displaying in wrong order. This fixes where the sort order in the api wasn't working properly.