1.0.0 • Published 8 years ago

handlebars-helper-formatdate v1.0.0

Weekly downloads
13
License
MIT
Repository
github
Last release
8 years ago

handlebars-helper-formatdate

Handlebars helper that format dates using moment.

Installation

npm install handlebars-helper-formatdate

Usage

In your templates:

<h1>{{ title }}</h1>

<span class="post-date">On {{ formatDate date 'MMM DD YYYY' }}</span>

In your front matters:

---
title: A post
description: A very simple post.
date: 2016-10-29
---
...

In your metalsmith script:

var handlebars = require('handlebars');
var hbtdate = require('handlebars-helper-formatdate')(handlebars);

handlebars Object

A Handlebars instance.

License

MIT License, see LICENSE for details.