json-date-parser
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

json-date-parser

Minimal function suitable for passing to JSON.parse to revive common date-time strings (including ISO and those weird .NET ones) into Date objects.

Implementation is cribbed straight from: json.date-extensions.

Differences:

  • Instead of polluting the core JSON object, it defines a completely separate function.
  • TypeScript type information is included.

Installation

npm install --save json-date-parser

Usage

import { jsonDateParser } from "json-date-parser"
 
// Call standard JSON parser but use jsonDateParser as a "reviver"
var parsedStuff = JSON.parse(stringOfJson, jsonDateParser);

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.13,767latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.13,767
1.0.01

Package Sidebar

Install

npm i json-date-parser

Weekly Downloads

3,768

Version

1.0.1

License

MIT

Last publish

Collaborators

  • danielearwicker