Create a gist now

Instantly share code, notes, and snippets.

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