Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "edtf", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Extended Date Time Format (EDTF) / ISO 8601-2 Parser and Library", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -25,3 +25,3 @@ # EDTF.js | ||
by "One of a Set", e.g., `[1760-12..]` which means "December 1760 | ||
or some later month". | ||
or some later month." | ||
@@ -57,3 +57,3 @@ ### ES6 | ||
Each type provides at least the following properties: the date's | ||
corresponding EDTF string, its minimal and maximal numeric value, | ||
corresponding EDTF string, its minimum and maximum numeric value, | ||
its type, as well as its date part values. | ||
@@ -81,3 +81,3 @@ | ||
semantics tend to align well with common-sense expectations -- but be | ||
careful, as always when type coercion is at play. | ||
careful, as always, when type coercion is at play. | ||
@@ -125,3 +125,3 @@ ### Unspecified, uncertain, and approximate dates | ||
Iteratable dates offer an `includes()` test as well which returns true | ||
Iterable dates offer an `includes()` test as well which returns true | ||
only if a given date is part of the iteration. For example: | ||
@@ -153,3 +153,3 @@ | ||
The generator `*between()` returns all the dates, by precision, | ||
between two dates; similarly, `*until()` returns all datesi in between | ||
between two dates; similarly, `*until()` returns all dates in between | ||
and includes the two dates themselves. | ||
@@ -167,3 +167,3 @@ | ||
EDTF's 'multiple dates', while sets model 'one of a set') are iterable. | ||
Date's are iterable. | ||
Dates are iterable. | ||
@@ -208,3 +208,3 @@ [...edtf('2015/2018')] | ||
Note that unspecified date values will always the least possible value, | ||
Note that unspecified date values will always return the least possible value, | ||
e.g., '2000' for '20XX'. Note, also, that EDTF.js will not parse impossible | ||
@@ -218,3 +218,3 @@ unspecified dates. For instance, none of the following examples can be | ||
Intervals, Sets, and Lists will contain their parsed constiutent dates in | ||
Intervals, Sets, and Lists will contain their parsed constituent dates in | ||
the values array: | ||
@@ -221,0 +221,0 @@ |
@@ -91,3 +91,3 @@ 'use strict' | ||
set precision(value) { | ||
P.set(this, Number(value) % 4) | ||
P.set(this, (value > 3) ? 0 : Number(value)) | ||
} | ||
@@ -94,0 +94,0 @@ |
@@ -30,2 +30,20 @@ 'use strict' | ||
describe('.precision', () => { | ||
it('YYYY', () => { | ||
expect(new Date([1980]).precision).to.eql(1) | ||
}) | ||
it('YYYY-MM', () => { | ||
expect(new Date([1980, 1]).precision).to.eql(2) | ||
}) | ||
it('YYYY-MM-DD', () => { | ||
expect(new Date([1980, 1, 23]).precision).to.eql(3) | ||
}) | ||
it('YYYY-MM-DDThh:mm:ss', () => { | ||
expect(new Date([1980, 1, 12, 10, 15, 30]).precision).to.eql(0) | ||
}) | ||
}) | ||
describe('.next()', () => { | ||
@@ -32,0 +50,0 @@ it('YYYY', () => { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
170267
2851