Socket
Book a DemoInstallSign in
Socket

handlebars-helper-datetime

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

handlebars-helper-datetime

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

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

{{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

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

Keywords

date

FAQs

Package last updated on 21 Jan 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts