Fixed sort by date (#1719)

* Fixed sort by date

Date property is in JSON string. So, we should parse it and sort later.

* fix type script error

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
This commit is contained in:
sarvani1997 2021-11-10 02:09:04 +05:30 committed by GitHub
parent 792d8832c6
commit 5fe26615f1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -199,6 +199,9 @@ function sortCards(cards: Card[], board: Board, activeView: BoardView, usersById
} else if (template.type === 'updatedBy') {
aValue = usersById[a.modifiedBy]?.username || ''
bValue = usersById[b.modifiedBy]?.username || ''
} else if (template.type === 'date') {
aValue = (aValue === '') ? '' : JSON.parse(aValue as string).from
bValue = (bValue === '') ? '' : JSON.parse(bValue as string).from
}
let result = 0