Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
planner-team-one
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
21
Issues
21
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Евгений Положенцев
planner-team-one
Commits
d8fa95f4
Commit
d8fa95f4
authored
Nov 30, 2022
by
Ermolaev Timur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#78
Релизовал полноценное редактирование
parent
ffcfc7b5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
11 deletions
+19
-11
MonthCalendar.js
planner-front/src/containers/MonthCalendar/MonthCalendar.js
+19
-11
No files found.
planner-front/src/containers/MonthCalendar/MonthCalendar.js
View file @
d8fa95f4
...
@@ -8,6 +8,7 @@ import { addCalendarTask, addCopyCalendarTask, deleteCalendarTask, editCalendarT
...
@@ -8,6 +8,7 @@ import { addCalendarTask, addCopyCalendarTask, deleteCalendarTask, editCalendarT
function
MonthCalendar
()
{
function
MonthCalendar
()
{
const
dispatch
=
useDispatch
();
const
dispatch
=
useDispatch
();
const
{
calendarTasks
}
=
useSelector
(
state
=>
state
.
tasks
);
const
{
calendarTasks
}
=
useSelector
(
state
=>
state
.
tasks
);
const
user
=
useSelector
(
state
=>
state
.
users
?.
user
);
const
[
hourFormat
,
setHourFormat
]
=
useState
(
false
);
const
[
hourFormat
,
setHourFormat
]
=
useState
(
false
);
const
[
dateNow
,
setDateNow
]
=
useState
({
month
:
''
,
year
:
''
})
const
[
dateNow
,
setDateNow
]
=
useState
({
month
:
''
,
year
:
''
})
...
@@ -152,6 +153,7 @@ function MonthCalendar() {
...
@@ -152,6 +153,7 @@ function MonthCalendar() {
const
day
=
currentTask
.
infoForCell
.
startDay
const
day
=
currentTask
.
infoForCell
.
startDay
const
due
=
dateToISOLikeButLocal
(
new
Date
(
dateNow
.
year
,
dateNow
.
month
,
day
,
timeEndHour
-
1
,
59
))
const
due
=
dateToISOLikeButLocal
(
new
Date
(
dateNow
.
year
,
dateNow
.
month
,
day
,
timeEndHour
-
1
,
59
))
const
start
=
dateToISOLikeButLocal
(
new
Date
(
dateNow
.
year
,
dateNow
.
month
,
day
,
timeStartHour
,
0
))
const
start
=
dateToISOLikeButLocal
(
new
Date
(
dateNow
.
year
,
dateNow
.
month
,
day
,
timeStartHour
,
0
))
if
(
currentTask
.
id
)
{
const
newTask
=
{
const
newTask
=
{
...
currentTask
,
...
currentTask
,
dateTimeStart
:
start
,
dateTimeStart
:
start
,
...
@@ -161,13 +163,19 @@ function MonthCalendar() {
...
@@ -161,13 +163,19 @@ function MonthCalendar() {
}
}
delete
newTask
.
infoForCell
delete
newTask
.
infoForCell
delete
newTask
.
id
delete
newTask
.
id
if
(
newTask
.
dateTimeTaskId
)
{
await
dispatch
(
editCalendarTask
(
newTask
))
await
dispatch
(
editCalendarTask
(
newTask
))
}
else
{
}
else
{
const
newTask
=
{
...
currentTask
,
dateTimeStart
:
start
,
dateTimeDue
:
due
,
executor
:
user
,
}
delete
newTask
.
infoForCell
delete
newTask
.
id
await
dispatch
(
addCalendarTask
(
newTask
))
await
dispatch
(
addCalendarTask
(
newTask
))
}
}
}
}
console
.
log
(
currentTask
)
const
createCopyTask
=
async
(
dayNumber
,
hour
)
=>
{
const
createCopyTask
=
async
(
dayNumber
,
hour
)
=>
{
const
hourDiff
=
copyTask
.
infoForCell
.
endHour
-
copyTask
.
infoForCell
.
startHour
const
hourDiff
=
copyTask
.
infoForCell
.
endHour
-
copyTask
.
infoForCell
.
startHour
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment