Skip to content

Instantly share code, notes, and snippets.

@jimjeffers
Created May 21, 2011 21:04
Show Gist options
  • Select an option

  • Save jimjeffers/984897 to your computer and use it in GitHub Desktop.

Select an option

Save jimjeffers/984897 to your computer and use it in GitHub Desktop.
Date Sorting Comparators
# item.getDate() assumes you are returning a Date object from your model.
dateComparator: (item) ->
item.getDate().getTime()
reverseDateComparator: (item) ->
-item.getDate().getTime()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment