react-weekly-planning 1.0.15 → 1.0.16
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/index.js +9 -0
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -221,4 +221,13 @@ export const updateOffsetWithDateCalendar = (calendarDate) => {
|
|
|
221
221
|
export const millisecondsToHours = (milliseconds) => {
|
|
222
222
|
return millisecondsToDate(milliseconds).formattedDate;
|
|
223
223
|
};
|
|
224
|
+
export const checkDuplicates = (tasks, taskStart, taskEnd) => {
|
|
225
|
+
const findDuplicates = tasks === null || tasks === void 0 ? void 0 : tasks.filter((task) => (taskStart >= task.taskStart && taskStart < task.taskEnd) ||
|
|
226
|
+
(taskEnd > task.taskStart && taskEnd < task.taskEnd) ||
|
|
227
|
+
(taskStart <= task.taskStart &&
|
|
228
|
+
taskEnd > task.taskStart &&
|
|
229
|
+
taskEnd >= task.taskEnd &&
|
|
230
|
+
taskStart <= task.taskEnd));
|
|
231
|
+
return findDuplicates.length > 0;
|
|
232
|
+
};
|
|
224
233
|
export default Calendar;
|