Last active
January 4, 2016 05:31
-
-
Save searleb/c3bdfdda0fc5e88fc02a to your computer and use it in GitHub Desktop.
Meteor Template Helper - Format Time with Moment.js
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
// requires Moment.js | |
// format time | |
UI.registerHelper('formatTime', function(time, formatting) { | |
if(time) { | |
return moment(time).format(formatting); | |
} | |
}); | |
// In Template: | |
// eg: | |
{{formatTime startdate 'DD MMM YY'}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment