@zeniai/client-epic-state 5.0.36-betaRR01 → 5.0.36-betaRR03

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.
@@ -46,9 +46,19 @@ export const getRecurringEndDateFromCount = (startDate, frequency, recurringCoun
46
46
  break;
47
47
  case 'weekly':
48
48
  case 'biweekly':
49
- case 'semi_weekly':
50
49
  endDate = startDate.add(getRecurringFrequencyInDays(frequency) * (recurringCount - 1), 'day');
51
50
  break;
51
+ case 'semi_weekly': {
52
+ // Two semi-weekly occurrences span exactly 7 days regardless of which
53
+ // two weekdays are picked (since gap1 + gap2 = 7). So odd counts are
54
+ // exact; even counts use the conservative half-week step (4 days).
55
+ const stepsRemaining = recurringCount - 1;
56
+ const fullWeekPairs = Math.floor(stepsRemaining / 2);
57
+ const hasOddTailStep = stepsRemaining % 2 === 1;
58
+ const days = fullWeekPairs * 7 + (hasOddTailStep ? 4 : 0);
59
+ endDate = startDate.add(days, 'day');
60
+ break;
61
+ }
52
62
  case 'monthly':
53
63
  endDate = startDate.add(recurringCount - 1, 'month');
54
64
  break;
@@ -12,6 +12,7 @@ export const initializeTaskToLocalStoreEpic = (actions$, state$) => actions$.pip
12
12
  description: task.description,
13
13
  status: task.status.code,
14
14
  assignee: task.assignees,
15
+ groupAssignees: task.groupAssignees,
15
16
  dueDate: task.dueDate,
16
17
  priority: task.priority.code,
17
18
  tagIds: task.tagIds,
@@ -91,13 +91,14 @@ const prepareTaskPayload = (state, taskId, taskGroupId) => {
91
91
  recurring_start_date: localData.type.code === 'recurring'
92
92
  ? (localData.recurringStartDate?.format(DEFAULT_DATE_FORMAT) ?? null)
93
93
  : null,
94
- ...(localData.type.code === 'recurring' &&
94
+ recurring_days_of_week: localData.type.code === 'recurring' &&
95
95
  localData.recurringFrequency === 'semi_weekly'
96
- ? { recurring_days_of_week: localData.recurringDaysOfWeek ?? [] }
97
- : {}),
96
+ ? (localData.recurringDaysOfWeek ?? [])
97
+ : null,
98
98
  sync_token: syncToken,
99
99
  task_group_ids: taskGroupId != null ? [taskGroupId] : [],
100
100
  time_spent: convertHHMMStrToMinutes(localData.timeSpent),
101
+ group_assignees: localData.groupAssignees,
101
102
  ...(taskId == null ? { is_private: localData.isPrivate ?? false } : {}),
102
103
  };
103
104
  };
@@ -3,6 +3,7 @@ export const initialTaskDetailLocalData = {
3
3
  description: '',
4
4
  status: 'todo',
5
5
  assignee: [],
6
+ groupAssignees: [],
6
7
  dueDate: undefined,
7
8
  priority: 'medium',
8
9
  tagIds: [],