Skip to content

DeeLindesay/dehumanize-date

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Return dates in just the format that computers should use:

  • 2008-08-09

Build Status Dependency Status NPM version

testling badge

Installation

$ npm install dehumanize-date

Usage

A simple function which takes a string as an argument and returns a string in the form yyyy-mm-dd.

var date = dehumanizeDate(userInput);

If you want to use US formats for numerical dates you should pass true as the second parameter:

var date = dehumanizeDate(userInput, true);

License

MIT

About

Parse dates in all the formats humans like to use.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%