Skip to content
Convert all Date instances in an object.
JavaScript CSS
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
test
.gitignore
History.md
Makefile
Readme.md
component.json
index.js
package.json

Readme.md

convert-dates

Convert all Date instances in an object.

Installation

$ component install segmentio/convert-dates

Example

var convert = require('convert-dates');
var obj = { date: new Date() };

obj = convert(obj, function (date) { return 'string'; });

obj.date; // "string"

API

convertDates(object, converter)

Passes all of the Date values in an object through the converter function.

License

MIT

Something went wrong with that request. Please try again.