Skip to content

Instantly share code, notes, and snippets.

@byplayer
Created June 9, 2017 09:02
Show Gist options
  • Save byplayer/076a3341a4f7b77b78625a1b74e9c94c to your computer and use it in GitHub Desktop.
Save byplayer/076a3341a4f7b77b78625a1b74e9c94c to your computer and use it in GitHub Desktop.
TodoTxtJs.TodoManager._compareDueDate = function (left, right) {
if (left.dueDate() || right.dueDate()) {
if (!left.dueDate())
return 1;
if (!right.dueDate())
return -1;
if (left.dueDate().getFullYear() !== right.dueDate().getFullYear()
|| left.dueDate().getMonth() !== right.dueDate().getMonth()
|| left.dueDate().getDay() !== right.dueDate().getDay()) {
return left.dueDate() < right.dueDate() ? -1 : 1;
}
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment