Socket
Socket
Sign inDemoInstall

luxon

Package Overview
Dependencies
Maintainers
1
Versions
145
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

luxon - npm Package Compare versions

Comparing version 0.2.4 to 0.2.5

4

changelog.md
# Changelog
## 0.2.5
* Better shiftTo behavior for durations with floating point components
## 0.2.4

@@ -4,0 +8,0 @@

2

package.json
{
"name": "luxon",
"version": "0.2.4",
"version": "0.2.5",
"description": "Immutable date wrapper",

@@ -5,0 +5,0 @@ "author": "Isaac Cambron",

@@ -478,11 +478,12 @@ import { Util } from './impl/util';

if (units.indexOf(k) >= 0) {
built[k] = 0;
lastUnit = k;
let own = 0;
// anything we haven't boiled down yet should get boiled to this unit
for (const ak in accumulated) {
if (accumulated.hasOwnProperty(ak)) {
built[k] += this.matrix[ak][k] * accumulated[ak];
own += this.matrix[ak][k] * accumulated[ak];
accumulated[ak] = 0;
}
delete accumulated[ak];
}

@@ -492,5 +493,9 @@

if (Util.isNumber(vals[k])) {
built[k] += vals[k];
own += vals[k];
}
const i = Math.trunc(own);
built[k] = i;
accumulated[k] = own - i;
// plus anything further down the chain that should be rolled up in to this

@@ -515,7 +520,9 @@ for (const down in vals) {

if (accumulated.hasOwnProperty(key)) {
built[lastUnit] += accumulated[key] / this.matrix[lastUnit][key];
if (accumulated[key] > 0) {
built[lastUnit] +=
key === lastUnit ? accumulated[key] : accumulated[key] / this.matrix[lastUnit][key];
}
}
}
}
return clone(this, { values: built }, true);

@@ -522,0 +529,0 @@ }

@@ -75,4 +75,4 @@ import { DateTime } from './datetime';

* @example Info.weekdays('short')[0] //=> 'Mon'
* @example Info.weekdays('short', 'fr-CA')[0] //=> 'lun.'
* @example Info.weekdays('short', 'ar')[0] //=> 'الاثنين'
* @example Info.weekdays('short', { locale: 'fr-CA' })[0] //=> 'lun.'
* @example Info.weekdays('short', { locale: 'ar' })[0] //=> 'الاثنين'
* @return {[string]}

@@ -105,3 +105,3 @@ */

* @example Info.meridiems() //=> [ 'AM', 'PM' ]
* @example Info.meridiems('de') //=> [ 'vorm.', 'nachm.' ]
* @example Info.meridiems({ locale: 'de' }) //=> [ 'vorm.', 'nachm.' ]
* @return {[string]}

@@ -120,3 +120,3 @@ */

* @example Info.eras('long') //=> [ 'Before Christ', 'Anno Domini' ]
* @example Info.eras('long', 'fr') //=> [ 'avant Jésus-Christ', 'après Jésus-Christ' ]
* @example Info.eras('long', { locale: 'fr' }) //=> [ 'avant Jésus-Christ', 'après Jésus-Christ' ]
* @return {[string]}

@@ -123,0 +123,0 @@ */

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc