Comparing version 1.17.1 to 1.17.2
# Changelog | ||
## 1.17.2 | ||
* Fix issue with `toRelative` using `style: short` with plural days | ||
## 1.17.1 | ||
@@ -4,0 +8,0 @@ |
{ | ||
"name": "luxon", | ||
"version": "1.17.1", | ||
"version": "1.17.2", | ||
"description": "Immutable date wrapper", | ||
@@ -5,0 +5,0 @@ "author": "Isaac Cambron", |
@@ -1,2 +0,2 @@ | ||
import { isUndefined, isNumber, normalizeObject } from "./impl/util.js"; | ||
import { isUndefined, isNumber, normalizeObject, hasOwnProperty } from "./impl/util.js"; | ||
import Locale from "./impl/locale.js"; | ||
@@ -460,3 +460,3 @@ import Formatter from "./impl/formatter.js"; | ||
for (const k of orderedUnits) { | ||
if (dur.values.hasOwnProperty(k) || this.values.hasOwnProperty(k)) { | ||
if (hasOwnProperty(dur.values, k) || hasOwnProperty(this.values, k)) { | ||
result[k] = dur.get(k) + this.get(k); | ||
@@ -463,0 +463,0 @@ } |
@@ -60,3 +60,3 @@ const numberingSystems = { | ||
} else { | ||
for (let key in numberingSystemsUTF16) { | ||
for (const key in numberingSystemsUTF16) { | ||
const [min, max] = numberingSystemsUTF16[key]; | ||
@@ -63,0 +63,0 @@ if (code >= min && code <= max) { |
@@ -130,6 +130,6 @@ import * as Formats from "./formats.js"; | ||
years: ["year", "yr."], | ||
quarters: ["quarer", "qtr."], | ||
quarters: ["quarter", "qtr."], | ||
months: ["month", "mo."], | ||
weeks: ["week", "wk."], | ||
days: ["day", "day"], | ||
days: ["day", "day", "days"], | ||
hours: ["hour", "hr."], | ||
@@ -157,3 +157,11 @@ minutes: ["minute", "min."], | ||
fmtValue = Math.abs(count), | ||
fmtUnit = narrow ? units[unit][1] : fmtValue === 1 ? units[unit][0] : unit; | ||
singular = fmtValue === 1, | ||
lilUnits = units[unit], | ||
fmtUnit = narrow | ||
? singular | ||
? lilUnits[1] | ||
: lilUnits[2] || lilUnits[1] | ||
: singular | ||
? units[unit][0] | ||
: unit; | ||
return isInPast ? `${fmtValue} ${fmtUnit} ago` : `in ${fmtValue} ${fmtUnit}`; | ||
@@ -160,0 +168,0 @@ } |
@@ -299,2 +299,3 @@ import { hasFormatToParts, hasIntl, padStart, roundTo, hasRelative } from "./util.js"; | ||
intlNumCache = {}; | ||
intlRelCache = {}; | ||
} | ||
@@ -307,3 +308,3 @@ | ||
constructor(locale, numbering, outputCalendar, specifiedLocale) { | ||
let [parsedLocale, parsedNumberingSystem, parsedOutputCalendar] = parseLocaleString(locale); | ||
const [parsedLocale, parsedNumberingSystem, parsedOutputCalendar] = parseLocaleString(locale); | ||
@@ -310,0 +311,0 @@ this.locale = parsedLocale; |
@@ -1,2 +0,2 @@ | ||
import { parseMillis, isUndefined, untruncateYear, signedOffset } from "./util.js"; | ||
import { parseMillis, isUndefined, untruncateYear, signedOffset, hasOwnProperty } from "./util.js"; | ||
import Formatter from "./formatter.js"; | ||
@@ -192,3 +192,3 @@ import FixedOffsetZone from "../zones/fixedOffsetZone.js"; | ||
for (const i in handlers) { | ||
if (handlers.hasOwnProperty(i)) { | ||
if (hasOwnProperty(handlers, i)) { | ||
const h = handlers[i], | ||
@@ -195,0 +195,0 @@ groups = h.groups ? h.groups + 1 : 1; |
@@ -82,2 +82,6 @@ /* | ||
export function hasOwnProperty(obj, prop) { | ||
return Object.prototype.hasOwnProperty.call(obj, prop); | ||
} | ||
// NUMBERS AND STRINGS | ||
@@ -242,3 +246,3 @@ | ||
for (const u in obj) { | ||
if (obj.hasOwnProperty(u)) { | ||
if (hasOwnProperty(obj, u)) { | ||
if (nonUnitKeys.indexOf(u) >= 0) continue; | ||
@@ -245,0 +249,0 @@ const v = obj[u]; |
@@ -168,3 +168,3 @@ import DateTime from "./datetime.js"; | ||
zones = false, | ||
relative = hasRelative(); | ||
relative = false; | ||
@@ -174,2 +174,3 @@ if (hasIntl()) { | ||
intlTokens = hasFormatToParts(); | ||
relative = hasRelative(); | ||
@@ -176,0 +177,0 @@ try { |
@@ -69,2 +69,3 @@ import { formatOffset, parseZoneInfo, isUndefined, ianaRegex, objToLocalTS } from "../impl/util.js"; | ||
} | ||
/** | ||
@@ -78,2 +79,3 @@ * Reset local caches. Should only be necessary in testing scenarios. | ||
} | ||
/** | ||
@@ -80,0 +82,0 @@ * Returns whether the provided string is a valid specifier. This only checks the string's format, not that the specifier identifies a known zone; see isValidZone for that. |
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 not supported yet
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 not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
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
2828402
32806