Skip to content

Instantly share code, notes, and snippets.

Created December 2, 2010 21:03
What would you like to do?
Example custom template tag for jQuery Templates plugin ($.tmpl)
// Relevant jQuery Template source:
// Example usage: {{pretty_datetime}}
$.extend(jQuery.tmpl.tag, {
"pretty_datetime": {
open: "if($notnull_1){_.push(pretty_datetime($1a));}"
function pretty_datetime(date) {
/* do something to date */
return date;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment