Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

date sort doesn't take times into account #17

Open
JoeGermuska opened this issue Sep 28, 2017 · 0 comments
Open

date sort doesn't take times into account #17

JoeGermuska opened this issue Sep 28, 2017 · 0 comments

Comments

@JoeGermuska
Copy link
Member

This quarter we have multiple events on the same day, flushing out that the date sort doesn't consider time, which sometimes results in lab lunch listing after evening events.

//order = -1 for reverse chronological
function dateSort(order, arr) {
var sorted = arr.sort(function(a, b) {
if (order == 1) {
return new Date(a.date) - new Date(b.date);
}
else {
return new Date(b.date) - new Date(a.date);
}
});
return sorted;
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant