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