Skip to content

danielearwicker/json-date-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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);

About

Minimal function suitable for passing to JSON.parse to revive common date-time strings into Date objects

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published