@outbuild-company/schedule-core 1.15.13 → 1.15.14

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.js CHANGED
@@ -16208,8 +16208,12 @@ async function dispatchCalendarReconcile(action, options, deps) {
16208
16208
  if (!shouldReconcile(activity, deps)) continue;
16209
16209
  const calendar = deps.ctx.calendars.getCalendar(activity.calendarId);
16210
16210
  if (!calendar) continue;
16211
+ const startReference = calendar.isWorkTime(
16212
+ activity.startDate,
16213
+ CALENDAR_UNIT.HOUR
16214
+ ) ? startOfUtcDay4(activity.startDate) : activity.startDate;
16211
16215
  const startDate = calendar.getClosestWorkTime({
16212
- date: activity.startDate,
16216
+ date: startReference,
16213
16217
  direction: WORK_TIME_DIRECTION.FUTURE,
16214
16218
  unit: CALENDAR_UNIT.HOUR
16215
16219
  });
@@ -16257,6 +16261,11 @@ function shouldReconcile(activity, deps) {
16257
16261
  function sameInstant(first, second) {
16258
16262
  return first.getTime() === second.getTime();
16259
16263
  }
16264
+ function startOfUtcDay4(date2) {
16265
+ return new Date(
16266
+ Date.UTC(date2.getUTCFullYear(), date2.getUTCMonth(), date2.getUTCDate())
16267
+ );
16268
+ }
16260
16269
 
16261
16270
  // src/activity-copy-paste/policy.ts
16262
16271
  var ACTIVITY_COPY_FIELDS = [