@bbn/bbn 1.0.470 → 1.0.471
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bbn.js +1 -1
- package/dist/bbn.js.map +1 -1
- package/dist/date.js +1 -1
- package/package.json +1 -1
package/dist/date.js
CHANGED
|
@@ -491,7 +491,7 @@ class bbnDateTool {
|
|
|
491
491
|
* @returns -1 if this < other, 0 if equal, 1 if this > other
|
|
492
492
|
*/
|
|
493
493
|
compare(date, unit = '') {
|
|
494
|
-
const d = new bbnDateTool(date);
|
|
494
|
+
const d = date instanceof bbnDateTool ? date : new bbnDateTool(date);
|
|
495
495
|
const realUnit = unitsCorrespondence[unit] || null;
|
|
496
496
|
// If no unit or unknown unit, fall back to timestamp comparison
|
|
497
497
|
if (!realUnit) {
|