Comparing version 1.1.14 to 1.1.15
Changelog | ||
========= | ||
### 1.1.15 (next) | ||
### 1.1.16 (next) | ||
### 1.1.15 | ||
### Bugfixes | ||
* Improve LocalDateTime.toInstant error handling | ||
* Improve validation of LocalDate parameter values when passed as Strings | ||
### ianna tzdb | ||
* First quick approach for parsing ZoneRegions | ||
### 1.1.14 | ||
@@ -8,0 +18,0 @@ |
{ | ||
"name": "js-joda", | ||
"version": "1.1.14", | ||
"version": "1.1.15", | ||
"description": "a date and time library for javascript", | ||
@@ -61,3 +61,3 @@ "repository": { | ||
"mocha": "^3.1.2", | ||
"nyc": "^9.0.1", | ||
"nyc": "^10.0.0", | ||
"phantomjs-prebuilt": "^2.1.13", | ||
@@ -64,0 +64,0 @@ "typescript": "^2.0.9", |
@@ -7,3 +7,3 @@ /* | ||
import {requireNonNull} from '../assert'; | ||
import {requireNonNull, requireInstance} from '../assert'; | ||
import {MathUtil} from '../MathUtil'; | ||
@@ -13,2 +13,3 @@ | ||
import {Instant} from '../Instant'; | ||
import {ZoneOffset} from '../ZoneOffset'; | ||
import {ChronoUnit} from '../temporal/ChronoUnit'; | ||
@@ -108,2 +109,3 @@ import {ChronoField} from '../temporal/ChronoField'; | ||
toInstant(offset) { | ||
requireInstance(offset, ZoneOffset, 'zoneId'); | ||
return Instant.ofEpochSecond(this.toEpochSecond(offset), this.toLocalTime().nano()); | ||
@@ -110,0 +112,0 @@ } |
@@ -276,10 +276,14 @@ /** | ||
super(); | ||
LocalTime._validate(hour, minute, second, nanoOfSecond); | ||
if ((minute | second | nanoOfSecond) === 0) { | ||
return LocalTime.HOURS[hour]; | ||
const _hour = MathUtil.safeZero(hour); | ||
const _minute = MathUtil.safeZero(minute); | ||
const _second = MathUtil.safeZero(second); | ||
const _nanoOfSecond = MathUtil.safeZero(nanoOfSecond); | ||
LocalTime._validate(_hour, _minute, _second, _nanoOfSecond); | ||
if ((_minute | _second | _nanoOfSecond) === 0) { | ||
return LocalTime.HOURS[_hour]; | ||
} | ||
this._hour = hour; | ||
this._minute = minute; | ||
this._second = second; | ||
this._nano = nanoOfSecond; | ||
this._hour = _hour; | ||
this._minute = _minute; | ||
this._second = _second; | ||
this._nano = _nanoOfSecond; | ||
} | ||
@@ -286,0 +290,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
3386926
82
36642