Convert query strings to dates for express/connect applications.
npm install express-query-dateexpress-query-date
==================
> Convert query strings to dates for express/connect applications.


npm install --save express-query-date
req.query.Load it right after bodyParser:
``js
var dateParser = require('express-query-date');
// [...]
app.use(bodyParser.json());
app.use(dateParser());
`
#### Without
`js`
// ?a=2015-01-01T05:00:00.000Z&b[c]=2015-01-01T05:00:00.000Z
console.log(req.query);
// => { a: '2015-01-01T05:00:00.000Z', b: { c: '2015-01-01T05:00:00.000Z' } }
#### With
`js`
// ?a=2015-01-01T05:00:00.000Z&b[c]=2015-01-01T05:00:00.000Z
console.log(req.query);
// => { a: Date 2015-01-01T05:00:00.000Z, b: { c: Date 2015-01-01T05:00:00.000Z } }
js
['x', moment.ISO_8601]
`To use your own, provide them when initializing the module:
`js
app.use(dateParser({
formats: ['MM-DD-YYYY']
}));
`See moment.js documentation for more.
$3
Strict format matching is on by default. To disable this, set options.strict to false when initializing the module.`js
app.use(dateParser({
strict: false
}));
``