$ npm install handlebars-helper-datetime
Handlebars helper for adding RFC-822 formatted datetimes to XML feeds
Use npm to install the package:
npm i handlebars-helper-datetime --save-dev
Use bower to install the package:
bower install handlebars-helper-datetime --save-dev
With the helper registered, you may now begin using it in your templates:
Use "now" as the date
Or pass in a context
Results in
Tue, 21 Jan 2014 03:08:11 -0500
The easiest way to register the helper with Assemble is to add the module to both devDependencies and keywords in your project's package.json:
{
"devDependencies": {
"handlebars-helper-datetime": "*"
},
"keywords": [
"handlebars-helper-datetime"
]
}
Alternatively, to register the helper explicitly in the Gruntfile:
grunt.initConfig({
assemble: {
options: {
// the 'handlebars-helper-datetime' npm module must also be listed in
// devDependencies for assemble to automatically resolve the helper
helpers: ['handlebars-helper-datetime', 'foo/*.js']
},
files: {
'dist/': ['src/templates/*.hbs']
}
}
});
Licensed under the MIT License. Copyright (c) 2014 Jon Schlinkert, contributors.