0.3.1 • Published 8 years ago

adaro-helper-formatdate v0.3.1

Weekly downloads
5
License
Apache-2.0
Repository
github
Last release
8 years ago

Adaro @formatDate Helper

Small adaro helper to format dates in your kraken js app

How to use

In your dust templates, like so:

{@formatDate date="{date}" format="{format}" /}

Or:

{@formatDate date="Fri Dec 10 1948 00:00:00 GMT+0100 (CET)" format="DD.MM.YYYY" /}

And rendered with a context like this:

dust.render('template', {date: 'Fri Dec 10 1948 00:00:00 GMT+0100 (CET)', format: 'DD.MM.YYYY' }, function (err, out) {
    if (err) {
        console.error(err);
    } else {
        console.log(out);
    }
});

Will give output 10.12.1948

Date formats supported

  • For 'date': All formats the javascript date constructor accepts ;-)
  • For 'format': All formats the moment js library supports
0.3.1

8 years ago

0.3.0

8 years ago

0.2.0

8 years ago