@outbuild-company/schedule-core 1.36.0 → 1.37.0
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/build-fingerprint.json +2 -2
- package/dist/cdn/schedule-core.global.js +1 -1
- package/dist/cdn/schedule-core.global.js.map +1 -1
- package/dist/index.cjs +28 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +94 -57
- package/dist/index.d.ts +94 -57
- package/dist/index.js +27 -13
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -8225,25 +8225,39 @@ function getVisibleBaseline(activity) {
|
|
|
8225
8225
|
return points.find((point) => point.isVisibleVersion) ?? null;
|
|
8226
8226
|
}
|
|
8227
8227
|
|
|
8228
|
-
// src/columns/baseline-variance/
|
|
8228
|
+
// src/columns/baseline-variance/baseline-variance-days.ts
|
|
8229
8229
|
var VARIANCE_DECIMAL_SCALE = 100;
|
|
8230
8230
|
var roundToVariancePrecision = (days) => Math.round(days * VARIANCE_DECIMAL_SCALE) / VARIANCE_DECIMAL_SCALE;
|
|
8231
|
-
function
|
|
8232
|
-
|
|
8233
|
-
const
|
|
8234
|
-
if (!
|
|
8235
|
-
|
|
8236
|
-
const
|
|
8231
|
+
function baselineVarianceDays(input) {
|
|
8232
|
+
const { endDate, baselineEnd, calendar, hoursPerDay } = input;
|
|
8233
|
+
const hasUsableHoursPerDay = Number.isFinite(hoursPerDay) && hoursPerDay > 0;
|
|
8234
|
+
if (!hasUsableHoursPerDay) return null;
|
|
8235
|
+
if (!baselineEnd || !endDate) return null;
|
|
8236
|
+
const hasValidDates = Number.isFinite(endDate.getTime()) && Number.isFinite(baselineEnd.getTime());
|
|
8237
|
+
if (!hasValidDates) return null;
|
|
8238
|
+
const finishesLate = endDate.getTime() > baselineEnd.getTime();
|
|
8239
|
+
const finishesEarly = baselineEnd.getTime() > endDate.getTime();
|
|
8237
8240
|
if (!finishesLate && !finishesEarly) return 0;
|
|
8238
|
-
const durationHours =
|
|
8239
|
-
|
|
8240
|
-
|
|
8241
|
-
|
|
8242
|
-
});
|
|
8241
|
+
const durationHours = calendar.calculateDuration(
|
|
8242
|
+
finishesLate ? baselineEnd : endDate,
|
|
8243
|
+
finishesLate ? endDate : baselineEnd
|
|
8244
|
+
);
|
|
8243
8245
|
const magnitude = roundToVariancePrecision(durationHours / hoursPerDay);
|
|
8244
8246
|
if (magnitude === 0) return 0;
|
|
8245
8247
|
return finishesLate ? magnitude : -magnitude;
|
|
8246
8248
|
}
|
|
8249
|
+
|
|
8250
|
+
// src/columns/baseline-variance/compute.ts
|
|
8251
|
+
function varianceDaysForBaselineEnd(activity, baselineEnd, calendars, hoursPerDay) {
|
|
8252
|
+
return baselineVarianceDays({
|
|
8253
|
+
endDate: activity.endDate,
|
|
8254
|
+
baselineEnd,
|
|
8255
|
+
calendar: {
|
|
8256
|
+
calculateDuration: (startDate, endDate) => calendars.calculateDuration({ startDate, endDate, task: activity })
|
|
8257
|
+
},
|
|
8258
|
+
hoursPerDay
|
|
8259
|
+
});
|
|
8260
|
+
}
|
|
8247
8261
|
function computeBaselineVarianceDays(activity, calendars, hoursPerDay) {
|
|
8248
8262
|
return varianceDaysForBaselineEnd(
|
|
8249
8263
|
activity,
|
|
@@ -38187,6 +38201,7 @@ exports.WORK_TIME_DIRECTION = WORK_TIME_DIRECTION;
|
|
|
38187
38201
|
exports.activityBackendRow = activityBackendRow;
|
|
38188
38202
|
exports.allowedSecondaryConstraintTypes = allowedSecondaryConstraintTypes;
|
|
38189
38203
|
exports.appendGroupRowId = appendGroupRowId;
|
|
38204
|
+
exports.baselineVarianceDays = baselineVarianceDays;
|
|
38190
38205
|
exports.buildGroupRowId = buildGroupRowId;
|
|
38191
38206
|
exports.checkNoUpdatedLinks = checkNoUpdatedLinks;
|
|
38192
38207
|
exports.computeExpectedProgress = computeExpectedProgress;
|
|
@@ -38201,6 +38216,7 @@ exports.expectedProgressFromBaseline = expectedProgressFromBaseline;
|
|
|
38201
38216
|
exports.formatUtcAsP6WallDate = formatUtcAsP6WallDate;
|
|
38202
38217
|
exports.getActiveBaseline = getActiveBaseline;
|
|
38203
38218
|
exports.getUnsavedActivities = getUnsavedActivities;
|
|
38219
|
+
exports.getVisibleBaseline = getVisibleBaseline;
|
|
38204
38220
|
exports.hostScheduleInput = hostScheduleInput;
|
|
38205
38221
|
exports.isRestorableActivityField = isRestorableActivityField;
|
|
38206
38222
|
exports.isRevertibleActivityField = isRevertibleActivityField;
|