Skip to content
Parse dates in all the formats humans like to use.
JavaScript
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
test
.gitignore
README.md
component.json
index.js
package.json

README.md

dehumanize-date

Parse dates in all the formats humans like to use:

  • today/tomorrow/yesterday
  • next/this/last Wednesday
  • 12th January
  • 12th January 1950
  • 09-08-2008
  • 2008-08-09

Installation

$ npm install dehumanize-date

or

$ component install ForbesLindesay/dehumanize-date

Usage

A simple function which takes a string as an argument and returns a plain JavaScript date object.

var date = dehumanizeDate(userInput);
Something went wrong with that request. Please try again.