react-weekly-planning 1.0.23 → 1.0.24
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/lib/utils.js +12 -10
- package/lib/utils.ts +4 -1
- package/package.json +1 -1
package/lib/utils.js
CHANGED
|
@@ -466,15 +466,17 @@ const sumHoursByGroups = (groupId, tasks, weekOffset, calendarDate) => {
|
|
|
466
466
|
return sum;
|
|
467
467
|
};
|
|
468
468
|
function saveTasksToLocalStorage(tasks) {
|
|
469
|
-
if (
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
469
|
+
if (typeof window !== "undefined") {
|
|
470
|
+
window.localStorage.setItem("Calendar", "je marche");
|
|
471
|
+
console.log(tasks);
|
|
472
|
+
const tasksSavedString = window.localStorage.getItem("CalendarTaskSaved");
|
|
473
|
+
const tasksString = JSON.stringify(tasks);
|
|
474
|
+
if (tasksSavedString === tasksString)
|
|
475
|
+
return;
|
|
476
|
+
if (tasksString === "[]")
|
|
477
|
+
return;
|
|
478
|
+
const backup = [...tasks.filter((task) => task.taskExpiryDate)];
|
|
479
|
+
window.localStorage.setItem("CalendarTaskSaved", JSON.stringify(backup));
|
|
480
|
+
}
|
|
479
481
|
}
|
|
480
482
|
export { getWeeksListUpdate, saveTasksToLocalStorage, clickedDate, getCalandarDays, startDateMilliseconds, endDateMilliseconds, getDayHourly, millisecondsToDate, getWeekDays, formatDateToCustomFormat, displayDayOnModalLeft, millisecondsToInt, getWeekMonthAndYear, getWeeksList, getDoubleWeeksList, calculerEcartSemaine, calculateTimeOfDayRange, getSessionStorageRecordForDragAndDrop, compareWeekOffset, sumHoursByGroups, };
|
package/lib/utils.ts
CHANGED
|
@@ -600,13 +600,16 @@ const sumHoursByGroups = (
|
|
|
600
600
|
};
|
|
601
601
|
|
|
602
602
|
function saveTasksToLocalStorage(tasks: TasksType) {
|
|
603
|
-
|
|
603
|
+
if (typeof window !== "undefined") {
|
|
604
|
+
window.localStorage.setItem("Calendar","je marche");
|
|
605
|
+
console.log(tasks);
|
|
604
606
|
const tasksSavedString = window.localStorage.getItem("CalendarTaskSaved");
|
|
605
607
|
const tasksString = JSON.stringify(tasks);
|
|
606
608
|
if (tasksSavedString === tasksString) return;
|
|
607
609
|
if (tasksString === "[]") return;
|
|
608
610
|
const backup = [...tasks.filter((task) => task.taskExpiryDate)];
|
|
609
611
|
window.localStorage.setItem("CalendarTaskSaved", JSON.stringify(backup));
|
|
612
|
+
}
|
|
610
613
|
}
|
|
611
614
|
|
|
612
615
|
export {
|