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 +1 -11
- package/docs/index.ts.html +2 -2
- package/lib/utils.js +8 -5
- package/lib/utils.ts +10 -6
- package/package.json +1 -1
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}:{
|
|
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>}) => React.ReactNode;</td>
|
|
333
|
+
<td>addTaskRender?: ({currentGroup,dayInfo}:{currentGroup: GroupFeildsType;dayInfo: dayInfoType}) => 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>
|
package/docs/index.ts.html
CHANGED
|
@@ -124,7 +124,7 @@ type GroupRiquiredFieldsType = {
|
|
|
124
124
|
/**
|
|
125
125
|
* Additional fields for a group.
|
|
126
126
|
*/
|
|
127
|
-
type GroupAdditionalFieldsType = Record<any,
|
|
127
|
+
type GroupAdditionalFieldsType = Record<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<any,
|
|
470
|
+
type TaskAdditionalFieldsType = Record<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
|
-
|
|
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
|
-
|
|
406
|
-
const
|
|
407
|
-
|
|
408
|
-
const
|
|
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=
|
|
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
|
-
|
|
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
|
-
|
|
522
|
-
const
|
|
523
|
-
|
|
524
|
-
const
|
|
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 } =
|