react-weekly-planning 1.0.21 → 1.0.23

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/README.md CHANGED
@@ -11,7 +11,7 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
11
11
 
12
12
  ![Planning Screenshot](https://raw.githubusercontent.com/Yvesmorel/react-pweekly-planning/main/assets/planning-screenshot.webp)
13
13
 
14
- [See the demo](https://react-weekly-planning-demo.vercel.app)
14
+
15
15
 
16
16
  #### `weekOffset`
17
17
 
package/lib/utils.js CHANGED
@@ -409,7 +409,6 @@ function calculerEcartSemaine(dateSelectionnee) {
409
409
  function semainesDepuisOrigine(annee, numeroSemaine) {
410
410
  const dateActuelle = new Date();
411
411
  const dateOrigine = new Date(dateActuelle.getFullYear() - 2, 0, 1);
412
- console.log(dateOrigine);
413
412
  const anneeOrigine = dateOrigine.getFullYear();
414
413
  const numeroSemaineOrigine = getWeekNumber(dateOrigine);
415
414
  let nombreSemaines = 0;
@@ -467,6 +466,8 @@ const sumHoursByGroups = (groupId, tasks, weekOffset, calendarDate) => {
467
466
  return sum;
468
467
  };
469
468
  function saveTasksToLocalStorage(tasks) {
469
+ if (!window)
470
+ return;
470
471
  const tasksSavedString = window.localStorage.getItem("CalendarTaskSaved");
471
472
  const tasksString = JSON.stringify(tasks);
472
473
  if (tasksSavedString === tasksString)
package/lib/utils.ts CHANGED
@@ -600,6 +600,7 @@ const sumHoursByGroups = (
600
600
  };
601
601
 
602
602
  function saveTasksToLocalStorage(tasks: TasksType) {
603
+ if (!window) return;
603
604
  const tasksSavedString = window.localStorage.getItem("CalendarTaskSaved");
604
605
  const tasksString = JSON.stringify(tasks);
605
606
  if (tasksSavedString === tasksString) return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-weekly-planning",
3
- "version": "1.0.21",
3
+ "version": "1.0.23",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "jest",