wsp-ms-core 1.1.6 → 1.1.8
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 +16 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -155,6 +155,22 @@ 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
|
+
diffInDaysInclusive(other) {
|
|
166
|
+
const left = this._dt.startOf("day");
|
|
167
|
+
const right = other._dt.startOf("day");
|
|
168
|
+
const days = Math.floor(right.diff(left, "days").days);
|
|
169
|
+
return days >= 0 ? days + 1 : days - 1;
|
|
170
|
+
}
|
|
171
|
+
diffInDaysAbs(other) {
|
|
172
|
+
return Math.abs(this.diffInDays(other));
|
|
173
|
+
}
|
|
158
174
|
compareValue(other, unit) {
|
|
159
175
|
const left = unit === "day" ? this._dt.startOf("day") : this._dt;
|
|
160
176
|
const right = unit === "day" ? other._dt.startOf("day") : other._dt;
|