{"_id":"nunjucks-date-filter","_rev":"7-db4b879d29038ab5db35712046eb00d7","name":"nunjucks-date-filter","description":"A 'date' filter for Nunjucks implementing moment.js","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"nunjucks-date-filter","version":"0.1.0","description":"A 'date' filter for Nunjucks implementing moment.js","main":"index.js","scripts":{"test":"mocha"},"repository":{"type":"git","url":"https://github.com/piwi/nunjucks-date-filter.git"},"keywords":["nunjucks","filter","date","moment"],"author":{"name":"piwi","email":"me@e-piwi.fr","url":"http://e-piwi.fr/"},"licenses":[{"type":"Apache-2.0","url":"https://github.com/piwi/grunt-nunjucks-render/blob/master/LICENSE"}],"bugs":{"url":"https://github.com/piwi/nunjucks-date-filter/issues"},"homepage":"https://github.com/piwi/nunjucks-date-filter","dependencies":{"moment":"^2.9.0"},"devDependencies":{"chai":"^2.1.2","mocha":"^2.2.1","nunjucks":"^1.2.0"},"gitHead":"374ee8e3a354b46a4120dc50d3a073f03e5757bd","_id":"nunjucks-date-filter@0.1.0","_shasum":"7592e75bee45ae3824fe74fffafb5a8e8009c5f5","_from":".","_npmVersion":"2.1.2","_nodeVersion":"0.10.15","_npmUser":{"name":"piwi","email":"me@e-piwi.fr"},"maintainers":[{"name":"piwi","email":"me@e-piwi.fr"}],"dist":{"shasum":"7592e75bee45ae3824fe74fffafb5a8e8009c5f5","tarball":"https://registry.npmjs.org/nunjucks-date-filter/-/nunjucks-date-filter-0.1.0.tgz","integrity":"sha512-iNnmaWBNvMXzSq7TYYd4qpLq+XzszNu1xe1axg3UvJEDBEoJaKUjlkFPCyIeGC7A6oln64yBW00o0c7kHjojAQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID2ycuEDl53HMmcEqg71nz0+cnPE+DpXsKbk2X3702qcAiEA1BMWcAE0ST6vNjItqwD4iqsPFCrrqPLjKuPBi0FMdxo="}]}},"0.1.1":{"name":"nunjucks-date-filter","version":"0.1.1","description":"A 'date' filter for Nunjucks implementing moment.js","main":"index.js","scripts":{"test":"mocha"},"repository":{"type":"git","url":"https://github.com/piwi/nunjucks-date-filter.git"},"keywords":["nunjucks","filter","date","moment"],"author":{"name":"piwi","email":"me@e-piwi.fr","url":"http://e-piwi.fr/"},"licenses":[{"type":"Apache-2.0","url":"https://github.com/piwi/grunt-nunjucks-render/blob/master/LICENSE"}],"bugs":{"url":"https://github.com/piwi/nunjucks-date-filter/issues"},"homepage":"https://github.com/piwi/nunjucks-date-filter","dependencies":{"moment":"^2.9.0"},"devDependencies":{"chai":"^2.1.2","mocha":"^2.2.1","nunjucks":"^1.2.0"},"gitHead":"b55c3c9c6cd75d1102394b77c019d19ce9240739","_id":"nunjucks-date-filter@0.1.1","_shasum":"a936d44d2cc9898d95c6ab7b2aba7084fa60aba6","_from":".","_npmVersion":"2.1.2","_nodeVersion":"0.10.15","_npmUser":{"name":"piwi","email":"me@e-piwi.fr"},"maintainers":[{"name":"piwi","email":"me@e-piwi.fr"}],"dist":{"shasum":"a936d44d2cc9898d95c6ab7b2aba7084fa60aba6","tarball":"https://registry.npmjs.org/nunjucks-date-filter/-/nunjucks-date-filter-0.1.1.tgz","integrity":"sha512-xKIMGB+UH1mRnk1/ofAVpU+6Fm52KQWfkCCjMWYohuBTj/Id/qy8zIVuE5lpwtavPyHz96sW2dCawNdPPhn0SQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICQMIkkVXrMXA8Nh6mb9fw7b2VRWkhYt7jSeBjqAT7E1AiAaxIsBRgZDBh5Z7Wd749kSxLjSkogK6AqQAxJBGHnUEw=="}]}}},"readme":"nunjucks-date-filter\n====================\n\n[![Build Status](https://travis-ci.org/piwi/nunjucks-date-filter.svg?branch=master)](https://travis-ci.org/piwi/nunjucks-date-filter)\n[![Code Climate](https://codeclimate.com/github/piwi/nunjucks-date-filter/badges/gpa.svg)](https://codeclimate.com/github/piwi/nunjucks-date-filter)\n\nThis defines a `date` filter for [Nunjucks](http://mozilla.github.io/nunjucks/) \nimplementing [moment.js](http://momentjs.com/), a rich date manager.\n\n\nGetting Started\n---------------\n\nYou may install this plugin with this command:\n\n```shell\nnpm install nunjucks-date-filter --save-dev\n```\n\n\nUsage\n-----\n\nYou must first include the filter and then add it to your *nunjucks* environment:\n\n```js\nvar dateFilter = require('nunjucks-date-filter');\n\nvar env = new nunjucks.Environment();\n\nenv.addFilter('date', dateFilter);\n```\n\nA shortcut is proposed in the package:\n\n```js\nvar dateFilter = require('nunjucks-date-filter');\n\ndateFilter.install(\n    [ env ]                     // by default, current nunjucks environment will be used\n    [ , custom_filter_name ]    // by default, the filter will be named \"date\"\n);\n```\n\nYou can also define a default date format:\n\n```js\nvar dateFilter = require('nunjucks-date-filter');\n\ndateFilter.setDefaultFormat('YYYY');\n```\n\nOnce it is installed, you can call the filter in your *nunjucks* templates:\n\n```\n// with no format\nThis blog has been created at {{ creation_date | date }}.\n\n// with a custom format\nThis blog has been created at {{ creation_date | date(\"YYYY\") }}.\n\n// with an addition first\nThis blog has been created at {{ creation_date | date(\"add\", 7, \"days\") | date }}.\n```\n\n\n*Momentjs* usage\n----------------\n\nThe moment library proposes [a large set of date formats](http://momentjs.com/docs/#/displaying/format/)\nyou can use to customize the filter output. It also embeds [a huge set of methods](http://momentjs.com/docs/#/get-set/) \nto manipulate dates. Any of these methods can be called using the filter, passing as many \narguments as needed (see example above).\n\n\nContributing\n------------\n\nIn lieu of a formal styleguide, take care to maintain the existing coding style. Add unit \ntests for any new or changed functionality. Lint and test your code using [Mocha](http://mochajs.org/).\n\n","maintainers":[{"name":"picas","email":"me@picas.fr"}],"time":{"modified":"2022-06-22T13:48:54.356Z","created":"2015-03-21T20:19:15.772Z","0.1.0":"2015-03-21T20:19:15.772Z","0.1.1":"2015-07-17T05:06:20.091Z"},"homepage":"https://github.com/piwi/nunjucks-date-filter","keywords":["nunjucks","filter","date","moment"],"repository":{"type":"git","url":"https://github.com/piwi/nunjucks-date-filter.git"},"author":{"name":"piwi","email":"me@e-piwi.fr","url":"http://e-piwi.fr/"},"bugs":{"url":"https://github.com/piwi/nunjucks-date-filter/issues"},"readmeFilename":"README.md"}