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
a2e91f14
Commit
a2e91f14
authored
Nov 07, 2022
by
Ermolaev Timur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#24
небольшие изменения
parent
0577363c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
9 deletions
+20
-9
MonthCalendarBody.js
...ont/src/components/MonthCalendarBody/MonthCalendarBody.js
+20
-9
No files found.
planner-front/src/components/MonthCalendarBody/MonthCalendarBody.js
View file @
a2e91f14
...
...
@@ -26,24 +26,24 @@ const exampleTasks=[
dateCreated
:
"26.10.2022"
},{
user
:
"first"
,
title
:
"
задача3
"
,
title
:
"
first
"
,
description
:
"описание задачи11111"
,
priority
:
"A"
,
author
:
"Ivan"
,
executor
:
"Arman"
,
dateTimeStart
:
"5.1
2
.2022 16:00:00"
,
dateTimeDue
:
"
27.10.2022 14:2
0:00"
,
dateTimeStart
:
"5.1
1
.2022 16:00:00"
,
dateTimeDue
:
"
5.11.2022 17:0
0:00"
,
id
:
1
,
dateCreated
:
"26.10.2022"
},{
user
:
"first"
,
title
:
"
задача на 4 xfcf
"
,
title
:
"
second
"
,
description
:
"описание задачи11111"
,
priority
:
"A"
,
author
:
"Ivan"
,
executor
:
"Arman"
,
dateTimeStart
:
"5.11.2022 16:00:00"
,
dateTimeDue
:
"5.11.2022
21:2
0:00"
,
dateTimeDue
:
"5.11.2022
17:0
0:00"
,
id
:
1
,
dateCreated
:
"26.10.2022"
}
...
...
@@ -61,7 +61,7 @@ function MonthCalendarBody({month, year}) {
setNewTasksWithInfoForCell
(
exampleTasks
,
month
,
year
)
},
[
month
,
year
])
const
getDaysInMonth
=
(
month
,
year
)
=>
{
const
getDaysInMonth
=
()
=>
{
return
new
Date
(
year
,
month
+
1
,
0
).
getDate
();
}
...
...
@@ -100,6 +100,7 @@ function MonthCalendarBody({month, year}) {
const
createTaskInCellHandler
=
(
month
,
year
,
dayOfWeek
,
dayNumber
,
dayHour
)
=>
{
const
newTasks
=
[...
tasksForCell
]
const
newTask
=
{
id
:
Date
.
now
(),
user
:
"first"
,
title
:
"Новая"
,
description
:
"описание задачи11111"
,
...
...
@@ -139,8 +140,18 @@ function MonthCalendarBody({month, year}) {
setDaysInMonth
(
newDaysInMonth
)
}
const
onChangeCellTaskTitle
=
(
e
,
id
)
=>
{
const
{
name
,
value
}
=
e
.
target
;
const
onChangeCellTaskTitle
=
(
e
,
task
)
=>
{
const
value
=
e
.
target
.
value
;
const
name
=
e
.
target
.
name
;
const
{
id
}
=
task
;
const
newTasks
=
tasksForCell
.
map
(
task
=>
{
if
(
task
.
id
===
id
)
{
return
{
...
task
,
[
name
]:
value
};
}
return
task
;
});
setTasksForCell
(
newTasks
);
exampleTasks
=
[...
newTasks
]
}
return
(
...
...
@@ -193,7 +204,7 @@ function MonthCalendarBody({month, year}) {
variant
=
"standard"
value
=
{
task
.
title
}
name
=
'title'
onChange
=
{(
e
)
=>
{
onChangeCellTaskTitle
(
e
)}}
><
/TextField
>
onChange
=
{(
e
)
=>
{
onChangeCellTaskTitle
(
e
,
task
)}}
><
/TextField
>
<
/Grid> : null
}
<
/Grid
>
)
...
...
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