wsp-ms-core 1.1.6 → 1.1.7
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/index.cjs +10 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -155,6 +155,16 @@ var _DateTime = class _DateTime extends ValueObject {
|
|
|
155
155
|
minusSeconds(seconds) {
|
|
156
156
|
return _DateTime.fromLuxon(this._dt.minus({ seconds }));
|
|
157
157
|
}
|
|
158
|
+
diffInDays(other) {
|
|
159
|
+
const left = this._dt.startOf("day");
|
|
160
|
+
const right = other._dt.startOf("day");
|
|
161
|
+
return Math.floor(
|
|
162
|
+
right.diff(left, "days").days
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
diffInDaysAbs(other) {
|
|
166
|
+
return Math.abs(this.diffInDays(other));
|
|
167
|
+
}
|
|
158
168
|
compareValue(other, unit) {
|
|
159
169
|
const left = unit === "day" ? this._dt.startOf("day") : this._dt;
|
|
160
170
|
const right = unit === "day" ? other._dt.startOf("day") : other._dt;
|