Skip to content

adambene/dustjs-helper-formatdate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Date formatting helper for Dust.js

For Node.js

var dust = require('dustjs-linkedin');
require('dustjs-helpers');
require('dustjs-helper-formatdate');

For the browser

<script src="/js/dust.js"></script>
<script src="/js/moment.js"></script>
<script src="/js/dustjs-helper-formatdate.js"></script>

Use in Dust template

<time>
    {@formatDate date="{myDate}" format="YYYY. MMMM Do HH:mm" lan="en-US"/}
</time>

or with Dust keys:

<time>
    {@formatDate date="{myDate}" format="{formatString}" lan="{locale}"/}
</time>

License

MIT license

..