Created
December 2, 2010 21:03
-
-
Save benvinegar/726057 to your computer and use it in GitHub Desktop.
Example custom template tag for jQuery Templates plugin ($.tmpl)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Relevant jQuery Template source: | |
// https://github.com/jquery/jquery-tmpl/blob/master/jquery.tmpl.js#L206 | |
// Example usage: {{pretty_datetime some.date.obj}} | |
$.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