handlebars-helper-datetime

0.1.0 • Public • Published

{{datetime}} NPM version

Handlebars helper for adding RFC-822 formatted datetimes to XML feeds

Installation

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

Usage

With the helper registered, you may now begin using it in your templates:

Use "now" as the date

{{datetime}}

Or pass in a context

{{datetime page.date}}

Results in

Tue, 21 Jan 2014 03:08:11 -0500

Usage with Assemble

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']
    }
  }
});

Author

Jon Schlinkert

License and Copyright

Licensed under the MIT License. Copyright (c) 2014 Jon Schlinkert, contributors.

Readme

Keywords

none

Package Sidebar

Install

npm i handlebars-helper-datetime

Weekly Downloads

25

Version

0.1.0

License

none

Last publish

Collaborators

  • jonschlinkert