@videsk/humanize-date
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -5,2 +5,6 @@ # Changelog | ||
## v1.1.1 | ||
- [FIX] Remove decimals | ||
## v1.1.0 | ||
@@ -7,0 +11,0 @@ |
{ | ||
"name": "@videsk/humanize-date", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Humanize dates making readable in locale and ultra lightweight", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -49,3 +49,3 @@ class HumanizeDate { | ||
if (!(unit in this.units)) throw new Error(`The available units are ${Object.keys(this.units)}`); | ||
return new Intl.RelativeTimeFormat(navigator.language, options).format(this.units[unit](this.from, this.to), (unit !== 'auto') ? unit : this.autoToUnitText(this.from, this.to)); | ||
return new Intl.RelativeTimeFormat(navigator.language, options).format(Math.floor(this.units[unit](this.from, this.to)), (unit !== 'auto') ? unit : this.autoToUnitText(this.from, this.to)); | ||
} | ||
@@ -61,3 +61,3 @@ | ||
if (!(unit in this.units)) throw new Error(`The available units are ${Object.keys(this.units)}`); | ||
return new Intl.RelativeTimeFormat(navigator.language, options).format(this.units[unit](this.from, this.to) * -1, (unit !== 'auto') ? unit : this.autoToUnitText(this.from, this.to)); | ||
return new Intl.RelativeTimeFormat(navigator.language, options).format(Math.floor(this.units[unit](this.from, this.to) * -1), (unit !== 'auto') ? unit : this.autoToUnitText(this.from, this.to)); | ||
} | ||
@@ -64,0 +64,0 @@ |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
47115
1