react-weekly-planning 1.0.5 → 1.0.6

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/docs/index.html CHANGED
@@ -330,18 +330,8 @@ taskId, taskStart taskEnd, task, taskDate, groupId, dayIndex
330
330
  </tr>
331
331
  <tr>
332
332
  <td><code>addTaskRender</code></td>
333
- <td>addTaskRender?: ({currentGroup,dayInfo}:{</td>
334
- <td></td>
335
- </tr>
336
- <tr>
337
- <td>currentGroup: GroupFeildsType;dayInfo: dayInfoType;</td>
338
- <td></td>
339
- <td></td>
340
- </tr>
341
- <tr>
342
- <td>}) =&gt; React.ReactNode;</td>
333
+ <td>addTaskRender?: ({currentGroup,dayInfo}:{currentGroup: GroupFeildsType;dayInfo: dayInfoType}) =&gt; React.ReactNode;</td>
343
334
  <td>Custom render function for adding a task.</td>
344
- <td></td>
345
335
  </tr>
346
336
  <tr>
347
337
  <td><code>tasks</code></td>
@@ -124,7 +124,7 @@ type GroupRiquiredFieldsType = {
124
124
  /**
125
125
  * Additional fields for a group.
126
126
  */
127
- type GroupAdditionalFieldsType = Record&lt;any, unknown>;
127
+ type GroupAdditionalFieldsType = Record&lt;any,any>;
128
128
 
129
129
  /**
130
130
  * Fields for a group, including both required and additional fields.
@@ -467,7 +467,7 @@ export type SumHoursHeadContainerPropsType = {
467
467
  /**
468
468
  * Additional fields for a task.
469
469
  */
470
- type TaskAdditionalFieldsType = Record&lt;any, unknown>;
470
+ type TaskAdditionalFieldsType = Record&lt;any, any>;
471
471
 
472
472
  /**
473
473
  * Fields for a task, including both required and additional fields.
package/lib/utils.js CHANGED
@@ -397,15 +397,18 @@ function getSessionStorageRecordForDragAndDrop(tasks, positionDay, dropGroupId)
397
397
  const dragdayIndex = window.sessionStorage.getItem("calendardragdayIndex");
398
398
  let newTask;
399
399
  let newTasks = [];
400
- // window.sessionStorage.clear();
400
+ window.sessionStorage.clear();
401
401
  if (!dragdayIndex || !dragtaskStart || !dragtaskEnd || !dragtaskId || !tasks)
402
402
  return;
403
403
  const dragTask = tasks.find((task) => task.taskId === dragtaskId);
404
404
  const dayIndex = parseInt(dragdayIndex);
405
- const ecartDaysIndex = positionDay - dayIndex;
406
- const ecartDays = ecartDaysIndex * 86400000;
407
- const taskDropStart = parseInt(dragtaskStart) + ecartDays;
408
- const taskDropEnd = parseInt(dragtaskEnd) + ecartDays;
405
+ let ecartDaysIndex = positionDay - dayIndex;
406
+ const convertTaskDropStart = new Date(parseInt(dragtaskStart));
407
+ convertTaskDropStart.setDate(convertTaskDropStart.getDate() + ecartDaysIndex);
408
+ const taskDropStart = convertTaskDropStart.getTime();
409
+ let convertTaskDropEnd = new Date(parseInt(dragtaskEnd));
410
+ convertTaskDropEnd.setDate(convertTaskDropEnd.getDate() + ecartDaysIndex);
411
+ const taskDropEnd = convertTaskDropEnd.getTime();
409
412
  const taskDropDate = new Date(taskDropStart);
410
413
  if (dragTask) {
411
414
  const { taskStart, taskEnd, taskDate, groupId, dayIndex } = dragTask, rest = __rest(dragTask, ["taskStart", "taskEnd", "taskDate", "groupId", "dayIndex"]);
package/lib/utils.ts CHANGED
@@ -464,7 +464,8 @@ function calculerEcartSemaine(dateSelectionnee: Date) {
464
464
  if (!dateSelectionnee) {
465
465
  return;
466
466
  }
467
- const selectedDateUpdated=updateSelectedDateForEcartSemaine(dateSelectionnee)
467
+ const selectedDateUpdated =
468
+ updateSelectedDateForEcartSemaine(dateSelectionnee);
468
469
 
469
470
  const dateActuelle = new Date();
470
471
 
@@ -513,15 +514,18 @@ function getSessionStorageRecordForDragAndDrop(
513
514
  const dragdayIndex = window.sessionStorage.getItem("calendardragdayIndex");
514
515
  let newTask: TaskFeildsType | any;
515
516
  let newTasks: TasksType = [];
516
- // window.sessionStorage.clear();
517
+ window.sessionStorage.clear();
517
518
  if (!dragdayIndex || !dragtaskStart || !dragtaskEnd || !dragtaskId || !tasks)
518
519
  return;
519
520
  const dragTask = tasks.find((task) => task.taskId === dragtaskId);
520
521
  const dayIndex = parseInt(dragdayIndex);
521
- const ecartDaysIndex = positionDay - dayIndex;
522
- const ecartDays = ecartDaysIndex * 86400000;
523
- const taskDropStart = parseInt(dragtaskStart) + ecartDays;
524
- const taskDropEnd = parseInt(dragtaskEnd) + ecartDays;
522
+ let ecartDaysIndex = positionDay - dayIndex;
523
+ const convertTaskDropStart = new Date(parseInt(dragtaskStart));
524
+ convertTaskDropStart.setDate(convertTaskDropStart.getDate() + ecartDaysIndex);
525
+ const taskDropStart = convertTaskDropStart.getTime();
526
+ let convertTaskDropEnd = new Date(parseInt(dragtaskEnd));
527
+ convertTaskDropEnd.setDate(convertTaskDropEnd.getDate() + ecartDaysIndex);
528
+ const taskDropEnd = convertTaskDropEnd.getTime();
525
529
  const taskDropDate = new Date(taskDropStart);
526
530
  if (dragTask) {
527
531
  const { taskStart, taskEnd, taskDate, groupId, dayIndex, ...rest } =
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-weekly-planning",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "jest",