Skip to content

Instantly share code, notes, and snippets.

@oshanz
Created January 29, 2015 09:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oshanz/f1f470c0e946dc0b49c1 to your computer and use it in GitHub Desktop.
Save oshanz/f1f470c0e946dc0b49c1 to your computer and use it in GitHub Desktop.
backbone viewHelper
sortMonths : function(months) {
return _.intersection(['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], months);
}
getUniqPluck : function(arg, useCache) {
if (useCache) {
return this[arg] = this[arg] || _.uniq(_.pluck(this.List, arg)).sort();
} else {
return _.uniq(_.pluck(this.List, arg));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment