0.0.8 • Published 10 years ago

edtfy v0.0.8

Weekly downloads
63
License
MIT
Repository
github
Last release
10 years ago

edtfy (bring your own pronunciation)

Circle CI

edtfy is a parser that transforms user input into the edtf format.

Install

npm install edtfy   #npm
bower install edtfy #bower

Usage

parse

edtfy = require('edtfy');
edtfy.locale('fr');
edtfy('29 mars 1988'); // 1988-03-29

locale

edtfy.locale(locale): define the locale

edtfy.locale(): retrieve the locale

Compatibility

Level 0

5.1.1 Date

inputoutput
20082008
december 19882008-12
02/03/19882001-02-03

5.1.2 Date and Time

Not supported for now.

5.1.3 Interval

inputoutput
from 1964 to 20081964/2008
June 2004 - August 20082004-06/2008-08
2/1/2004 / 2/8/20052004-02-01/2008-02-08
02/01/2004-20052004-02-01/2005
from 2005 to June 20062005/2006-02

Level 1

5.2.1 Uncertain/Approximate

inputoutput
1984?1984?
June 2004?2004-06?
June the 11th, 2004?2004-06-11?
around 19841984~
about 1984?1984?~

5.2.2 Unspecified

inputoutput
199u199u
1999-uu1999-uu
1999-01-uu1999-01-uu
1999-uu-uu1999-uu-uu

5.2.3. Extended Interval (L1)

inputoutput
from 06/01/2004 to unknown2004-06-01/unknown
from 01/01/2004 to open2004-01-01/open
from around 1984 to June 20041984~/2004-06
1984 - around June 20041984/2004-06~
1984? - ~2004?1984?/2004?~

5.2.4 Year Exceeding Four Digits (L1)

inputoutput
170000002y170000002
-170000002y-170000002

5.2.5 Season

inputoutput
Spring 20012001-21

Level 2

5.3.1 Partial Uncertain/Approximate

Not supported for now.

5.3.2 Partial Unspecified

inputoutput
12/25/156u156u-12-25
12/25/156uu15uu-12-25
12/uu/15uu15uu-12-uu
uu/25/15601560-uu-25

5.3.3 One of a Set

The .. feature is only supported of before and after for now.

inputoutput
1667 or 1668 or 16701667,1668,1670
Jan 1760 or Feb 1760 or December 17601760-01,1760-02,1760-12
1667 or 12/17601667,1760-12
before 1930..,1930
after march 20042004-03,..

5.3.4 Multiple Dates

The .. feature is not supported for now.

inputoutput
1667 and 1668 and 1670{1667,1668,1670}
1960 and December 1961{1960,1961-12}

5.4.5 Masked Precision

inputoutput
196x196x
19xx19xx

5.3.6 Extended Interval (L2)

Not supported for now.

License

MIT © Nicolas Barbotte

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago

0.0.1-beta.8

10 years ago

0.0.1-beta.7

10 years ago

0.0.1-beta.6

10 years ago

0.0.1-beta.5

10 years ago

0.0.1-beta.4

11 years ago

0.0.1-beta.3

11 years ago

0.0.1-beta.2

11 years ago

0.0.1-beta.1

11 years ago