@phensley/cldr-core
Advanced tools
Comparing version 1.8.1 to 1.8.2
@@ -802,4 +802,4 @@ import { __assign } from "tslib"; | ||
var computeBaseFields = function (f) { | ||
var jd = f[1 /* DateField.JULIAN_DAY */]; | ||
checkJDRange(jd); | ||
var jd = clamp(f[1 /* DateField.JULIAN_DAY */], 0 /* CalendarConstants.JD_MIN */, 4881503 /* CalendarConstants.JD_MAX */); | ||
// checkJDRange(jd); | ||
var msDay = f[13 /* DateField.MILLIS_IN_DAY */]; | ||
@@ -825,8 +825,11 @@ var ms = msDay + (jd - 2440588 /* CalendarConstants.JD_UNIX_EPOCH */) * 86400000 /* CalendarConstants.ONE_DAY_MS */; | ||
}; | ||
var checkJDRange = function (jd) { | ||
if (jd < 0 /* CalendarConstants.JD_MIN */ || jd > 4881503 /* CalendarConstants.JD_MAX */) { | ||
throw new Error("Julian day ".concat(jd, " is outside the supported range of this library: ") + | ||
"".concat("Mon Jan 1 4713 B.C." /* ConstantsDesc.JD_MIN */, " to ").concat("Fri Dec 31 8652 A.D." /* ConstantsDesc.JD_MAX */)); | ||
} | ||
}; | ||
// TODO: clamp range instead of throwing error. | ||
// const checkJDRange = (jd: number): void => { | ||
// if (jd < CalendarConstants.JD_MIN || jd > CalendarConstants.JD_MAX) { | ||
// throw new Error( | ||
// `Julian day ${jd} is outside the supported range of this library: ` + | ||
// `${ConstantsDesc.JD_MIN} to ${ConstantsDesc.JD_MAX}`, | ||
// ); | ||
// } | ||
// }; | ||
/** | ||
@@ -833,0 +836,0 @@ * Given a Julian day and local milliseconds (in UTC), return the Unix |
export declare const enum CalendarConstants { | ||
ISO8601_MIN_DAYS = 4, | ||
MIN_YEAR = 4713, | ||
JD_MIN = 0, | ||
@@ -5,0 +4,0 @@ JD_UNIX_EPOCH = 2440588, |
{ | ||
"name": "@phensley/cldr-core", | ||
"version": "1.8.1", | ||
"version": "1.8.2", | ||
"description": "Core library for @phensley/cldr", | ||
@@ -39,11 +39,11 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@phensley/cldr-types": "workspace:~1.8.1", | ||
"@phensley/cldr-utils": "workspace:~1.8.1", | ||
"@phensley/decimal": "workspace:~1.8.1", | ||
"@phensley/language-tag": "workspace:~1.8.1", | ||
"@phensley/locale": "workspace:~1.8.1", | ||
"@phensley/locale-matcher": "workspace:~1.8.1", | ||
"@phensley/messageformat": "workspace:~1.8.1", | ||
"@phensley/plurals": "workspace:~1.8.1", | ||
"@phensley/timezone": "workspace:~1.8.1", | ||
"@phensley/cldr-types": "workspace:~1.8.2", | ||
"@phensley/cldr-utils": "workspace:~1.8.2", | ||
"@phensley/decimal": "workspace:~1.8.2", | ||
"@phensley/language-tag": "workspace:~1.8.2", | ||
"@phensley/locale": "workspace:~1.8.2", | ||
"@phensley/locale-matcher": "workspace:~1.8.2", | ||
"@phensley/messageformat": "workspace:~1.8.2", | ||
"@phensley/plurals": "workspace:~1.8.2", | ||
"@phensley/timezone": "workspace:~1.8.2", | ||
"tslib": "^2.6.2" | ||
@@ -50,0 +50,0 @@ }, |
@@ -805,4 +805,4 @@ "use strict"; | ||
var computeBaseFields = function (f) { | ||
var jd = f[1 /* DateField.JULIAN_DAY */]; | ||
checkJDRange(jd); | ||
var jd = clamp(f[1 /* DateField.JULIAN_DAY */], 0 /* CalendarConstants.JD_MIN */, 4881503 /* CalendarConstants.JD_MAX */); | ||
// checkJDRange(jd); | ||
var msDay = f[13 /* DateField.MILLIS_IN_DAY */]; | ||
@@ -828,8 +828,11 @@ var ms = msDay + (jd - 2440588 /* CalendarConstants.JD_UNIX_EPOCH */) * 86400000 /* CalendarConstants.ONE_DAY_MS */; | ||
}; | ||
var checkJDRange = function (jd) { | ||
if (jd < 0 /* CalendarConstants.JD_MIN */ || jd > 4881503 /* CalendarConstants.JD_MAX */) { | ||
throw new Error("Julian day ".concat(jd, " is outside the supported range of this library: ") + | ||
"".concat("Mon Jan 1 4713 B.C." /* ConstantsDesc.JD_MIN */, " to ").concat("Fri Dec 31 8652 A.D." /* ConstantsDesc.JD_MAX */)); | ||
} | ||
}; | ||
// TODO: clamp range instead of throwing error. | ||
// const checkJDRange = (jd: number): void => { | ||
// if (jd < CalendarConstants.JD_MIN || jd > CalendarConstants.JD_MAX) { | ||
// throw new Error( | ||
// `Julian day ${jd} is outside the supported range of this library: ` + | ||
// `${ConstantsDesc.JD_MIN} to ${ConstantsDesc.JD_MAX}`, | ||
// ); | ||
// } | ||
// }; | ||
/** | ||
@@ -836,0 +839,0 @@ * Given a Julian day and local milliseconds (in UTC), return the Unix |
export declare const enum CalendarConstants { | ||
ISO8601_MIN_DAYS = 4, | ||
MIN_YEAR = 4713, | ||
JD_MIN = 0, | ||
@@ -5,0 +4,0 @@ JD_UNIX_EPOCH = 2440588, |
{ | ||
"name": "@phensley/cldr-core", | ||
"version": "1.8.1", | ||
"version": "1.8.2", | ||
"description": "Core library for @phensley/cldr", | ||
@@ -39,11 +39,11 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@phensley/cldr-types": "workspace:~1.8.1", | ||
"@phensley/cldr-utils": "workspace:~1.8.1", | ||
"@phensley/decimal": "workspace:~1.8.1", | ||
"@phensley/language-tag": "workspace:~1.8.1", | ||
"@phensley/locale": "workspace:~1.8.1", | ||
"@phensley/locale-matcher": "workspace:~1.8.1", | ||
"@phensley/messageformat": "workspace:~1.8.1", | ||
"@phensley/plurals": "workspace:~1.8.1", | ||
"@phensley/timezone": "workspace:~1.8.1", | ||
"@phensley/cldr-types": "workspace:~1.8.2", | ||
"@phensley/cldr-utils": "workspace:~1.8.2", | ||
"@phensley/decimal": "workspace:~1.8.2", | ||
"@phensley/language-tag": "workspace:~1.8.2", | ||
"@phensley/locale": "workspace:~1.8.2", | ||
"@phensley/locale-matcher": "workspace:~1.8.2", | ||
"@phensley/messageformat": "workspace:~1.8.2", | ||
"@phensley/plurals": "workspace:~1.8.2", | ||
"@phensley/timezone": "workspace:~1.8.2", | ||
"tslib": "^2.6.2" | ||
@@ -50,0 +50,0 @@ }, |
{ | ||
"name": "@phensley/cldr-core", | ||
"version": "1.8.1", | ||
"version": "1.8.2", | ||
"description": "Core library for @phensley/cldr", | ||
@@ -23,11 +23,11 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@phensley/cldr-types": "~1.8.1", | ||
"@phensley/cldr-utils": "~1.8.1", | ||
"@phensley/decimal": "~1.8.1", | ||
"@phensley/language-tag": "~1.8.1", | ||
"@phensley/locale": "~1.8.1", | ||
"@phensley/locale-matcher": "~1.8.1", | ||
"@phensley/messageformat": "~1.8.1", | ||
"@phensley/plurals": "~1.8.1", | ||
"@phensley/timezone": "~1.8.1", | ||
"@phensley/cldr-types": "~1.8.2", | ||
"@phensley/cldr-utils": "~1.8.2", | ||
"@phensley/decimal": "~1.8.2", | ||
"@phensley/language-tag": "~1.8.2", | ||
"@phensley/locale": "~1.8.2", | ||
"@phensley/locale-matcher": "~1.8.2", | ||
"@phensley/messageformat": "~1.8.2", | ||
"@phensley/plurals": "~1.8.2", | ||
"@phensley/timezone": "~1.8.2", | ||
"tslib": "^2.6.2" | ||
@@ -34,0 +34,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
2287662
22881
Updated@phensley/cldr-types@~1.8.2
Updated@phensley/cldr-utils@~1.8.2
Updated@phensley/decimal@~1.8.2
Updated@phensley/locale@~1.8.2
Updated@phensley/plurals@~1.8.2
Updated@phensley/timezone@~1.8.2