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
08779b92
Commit
08779b92
authored
Dec 27, 2022
by
Евгений Положенцев
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#123
fix on deadline create and edit
parent
d59017da
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
216 additions
and
37 deletions
+216
-37
helpers.ts
planner-api/src/helpers.ts
+1
-1
tasks.ts
planner-api/src/routers/tasks.ts
+9
-4
package-lock.json
planner-front/package-lock.json
+126
-0
DateTimePicker.js
.../components/Calendars/UI/DateTimePicker/DateTimePicker.js
+23
-0
CustomTableCell.js
...front/src/components/MyTasksCompoments/CustomTableCell.js
+3
-3
DateTimePicker.js
...onents/MyTasksCompoments/DateTimePicker/DateTimePicker.js
+30
-9
NewTaskForm.js
...ner-front/src/components/MyTasksCompoments/NewTaskForm.js
+10
-4
TableRowTask.js
...components/MyTasksCompoments/TableRowTask/TableRowTask.js
+1
-10
Select.js
planner-front/src/components/UI/Select/Select.js
+6
-5
MyTasks.js
planner-front/src/containers/MyTasks/MyTasks.js
+7
-1
No files found.
planner-api/src/helpers.ts
View file @
08779b92
...
@@ -141,7 +141,7 @@ export const taskFinderById = async (taskId:string):Promise<null | Task>=>{
...
@@ -141,7 +141,7 @@ export const taskFinderById = async (taskId:string):Promise<null | Task>=>{
where
:{
where
:{
id
:
taskId
id
:
taskId
}
}
})
})
return
task
return
task
}
}
...
...
planner-api/src/routers/tasks.ts
View file @
08779b92
...
@@ -15,12 +15,12 @@ const dataSource = myDataSource;
...
@@ -15,12 +15,12 @@ const dataSource = myDataSource;
router
.
get
(
'/'
,
async
(
req
:
Request
,
res
:
Response
):
Promise
<
Response
>
=>
{
router
.
get
(
'/'
,
async
(
req
:
Request
,
res
:
Response
):
Promise
<
Response
>
=>
{
const
tasks
=
await
dataSource
const
tasks
=
await
dataSource
.
getRepository
(
Task
)
.
getRepository
(
Task
)
.
find
({
.
find
({
relations
:{
relations
:{
executor
:
true
,
executor
:
true
,
author
:
true
,
author
:
true
,
}})
}})
return
res
.
send
({
tasks
})
return
res
.
send
({
tasks
})
})
})
...
@@ -30,10 +30,11 @@ router.post('/', auth, async(req:Request, res:Response):Promise<Response>=>{
...
@@ -30,10 +30,11 @@ router.post('/', auth, async(req:Request, res:Response):Promise<Response>=>{
let
dateTimeDueFinal
=
dateTimeDue
let
dateTimeDueFinal
=
dateTimeDue
let
dateTimeStartFinal
=
dateTimeStart
let
dateTimeStartFinal
=
dateTimeStart
let
dateTimeDeadlineFinal
=
dateTimeDeadLine
let
dateTimeDeadlineFinal
=
dateTimeDeadLine
if
(
!
dateTimeDue
&&
dateTimeDeadLine
)
{
if
(
!
dateTimeDue
&&
dateTimeDeadLine
)
{
dateTimeDueFinal
=
dateTimeDeadLine
dateTimeDueFinal
=
dateTimeDeadLine
dateTimeStartFinal
=
subtractHours
(
dateTimeDueFinal
,
1
)
dateTimeStartFinal
=
subtractHours
(
dateTimeDueFinal
,
1
)
}
}
console
.
log
(
'datTeimeDeadLine '
,
dateTimeDeadLine
)
const
newTask
=
new
Task
();
const
newTask
=
new
Task
();
newTask
.
title
=
title
;
newTask
.
title
=
title
;
...
@@ -312,6 +313,10 @@ router.put('/:taskId',auth,authAuthorOrExecutorOfTask,async(req:Request, res:Res
...
@@ -312,6 +313,10 @@ router.put('/:taskId',auth,authAuthorOrExecutorOfTask,async(req:Request, res:Res
dateTimeDue
,
executor
,
accomplish
,
dateTimeDeadLine
,
dateTimeFactDeadLine
,
priority
}
=
req
.
body
;
dateTimeDue
,
executor
,
accomplish
,
dateTimeDeadLine
,
dateTimeFactDeadLine
,
priority
}
=
req
.
body
;
const
task
=
await
taskFinderById
(
taskId
)
const
task
=
await
taskFinderById
(
taskId
)
if
(
!
task
)
return
res
.
status
(
404
).
send
({
Message
:
'task not found'
})
if
(
!
task
)
return
res
.
status
(
404
).
send
({
Message
:
'task not found'
})
console
.
log
(
'dateTimeDeadLine '
,
dateTimeDeadLine
,
'authorStatus '
,
authorStatus
,
'executorStatus '
,
executorStatus
)
let
dateTimeTask
=
null
;
let
dateTimeTask
=
null
;
if
(
dateTimeTaskId
)
{
if
(
dateTimeTaskId
)
{
const
dateTimeTaskData
=
await
dataSource
const
dateTimeTaskData
=
await
dataSource
...
@@ -323,7 +328,7 @@ router.put('/:taskId',auth,authAuthorOrExecutorOfTask,async(req:Request, res:Res
...
@@ -323,7 +328,7 @@ router.put('/:taskId',auth,authAuthorOrExecutorOfTask,async(req:Request, res:Res
if
(
!
dateTimeTask
)
return
res
.
status
(
404
).
send
({
Message
:
'dateTimeTask not found'
})
if
(
!
dateTimeTask
)
return
res
.
status
(
404
).
send
({
Message
:
'dateTimeTask not found'
})
dateTimeTask
=
dateTimeTaskData
dateTimeTask
=
dateTimeTaskData
}
}
if
(
dateTimeTask
!==
null
)
{
if
(
dateTimeTask
!==
null
)
{
dateTimeTask
.
dateTimeStart
=
dateTimeStart
dateTimeTask
.
dateTimeStart
=
dateTimeStart
dateTimeTask
.
dateTimeDue
=
dateTimeDue
dateTimeTask
.
dateTimeDue
=
dateTimeDue
...
...
planner-front/package-lock.json
View file @
08779b92
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
"moment": "^2.29.4",
"moment": "^2.29.4",
"prop-types": "^15.8.1",
"prop-types": "^15.8.1",
"react": "^18.2.0",
"react": "^18.2.0",
"react-datepicker": "^4.8.0",
"react-dom": "^18.2.0",
"react-dom": "^18.2.0",
"react-redux": "^8.0.4",
"react-redux": "^8.0.4",
"react-router-dom": "^6.4.2",
"react-router-dom": "^6.4.2",
...
@@ -6217,6 +6218,11 @@
...
@@ -6217,6 +6218,11 @@
"resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.2.tgz",
"resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.2.tgz",
"integrity": "sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA=="
"integrity": "sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA=="
},
},
"node_modules/classnames": {
"version": "2.3.2",
"resolved": "https://registry.npmjs.org/classnames/-/classnames-2.3.2.tgz",
"integrity": "sha512-CSbhY4cFEJRe6/GQzIk5qXZ4Jeg5pcsP7b5peFSDpffpe1cqjASH/n9UTjBwOp6XpMSTwQ8Za2K5V02ueA7Tmw=="
},
"node_modules/clean-css": {
"node_modules/clean-css": {
"version": "5.3.1",
"version": "5.3.1",
"resolved": "https://registry.npmjs.org/clean-css/-/clean-css-5.3.1.tgz",
"resolved": "https://registry.npmjs.org/clean-css/-/clean-css-5.3.1.tgz",
...
@@ -6922,6 +6928,18 @@
...
@@ -6922,6 +6928,18 @@
"node": ">=10"
"node": ">=10"
}
}
},
},
"node_modules/date-fns": {
"version": "2.29.3",
"resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.29.3.tgz",
"integrity": "sha512-dDCnyH2WnnKusqvZZ6+jA1O51Ibt8ZMRNkDZdyAyK4YfbDwa/cEmuztzG5pk6hqlp9aSBPYcjOlktquahGwGeA==",
"engines": {
"node": ">=0.11"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/date-fns"
}
},
"node_modules/dayjs": {
"node_modules/dayjs": {
"version": "1.11.6",
"version": "1.11.6",
"resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.6.tgz",
"resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.6.tgz",
...
@@ -15237,6 +15255,23 @@
...
@@ -15237,6 +15255,23 @@
"node": ">=14"
"node": ">=14"
}
}
},
},
"node_modules/react-datepicker": {
"version": "4.8.0",
"resolved": "https://registry.npmjs.org/react-datepicker/-/react-datepicker-4.8.0.tgz",
"integrity": "sha512-u69zXGHMpxAa4LeYR83vucQoUCJQ6m/WBsSxmUMu/M8ahTSVMMyiyQzauHgZA2NUr9y0FUgOAix71hGYUb6tvg==",
"dependencies": {
"@popperjs/core": "^2.9.2",
"classnames": "^2.2.6",
"date-fns": "^2.24.0",
"prop-types": "^15.7.2",
"react-onclickoutside": "^6.12.0",
"react-popper": "^2.2.5"
},
"peerDependencies": {
"react": "^16.9.0 || ^17 || ^18",
"react-dom": "^16.9.0 || ^17 || ^18"
}
},
"node_modules/react-dev-utils": {
"node_modules/react-dev-utils": {
"version": "12.0.1",
"version": "12.0.1",
"resolved": "https://registry.npmjs.org/react-dev-utils/-/react-dev-utils-12.0.1.tgz",
"resolved": "https://registry.npmjs.org/react-dev-utils/-/react-dev-utils-12.0.1.tgz",
...
@@ -15371,11 +15406,43 @@
...
@@ -15371,11 +15406,43 @@
"resolved": "https://registry.npmjs.org/react-error-overlay/-/react-error-overlay-6.0.11.tgz",
"resolved": "https://registry.npmjs.org/react-error-overlay/-/react-error-overlay-6.0.11.tgz",
"integrity": "sha512-/6UZ2qgEyH2aqzYZgQPxEnz33NJ2gNsnHA2o5+o4wW9bLM/JYQitNP9xPhsXwC08hMMovfGe/8retsdDsczPRg=="
"integrity": "sha512-/6UZ2qgEyH2aqzYZgQPxEnz33NJ2gNsnHA2o5+o4wW9bLM/JYQitNP9xPhsXwC08hMMovfGe/8retsdDsczPRg=="
},
},
"node_modules/react-fast-compare": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/react-fast-compare/-/react-fast-compare-3.2.0.tgz",
"integrity": "sha512-rtGImPZ0YyLrscKI9xTpV8psd6I8VAtjKCzQDlzyDvqJA8XOW78TXYQwNRNd8g8JZnDu8q9Fu/1v4HPAVwVdHA=="
},
"node_modules/react-is": {
"node_modules/react-is": {
"version": "17.0.2",
"version": "17.0.2",
"resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz",
"resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz",
"integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w=="
"integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w=="
},
},
"node_modules/react-onclickoutside": {
"version": "6.12.2",
"resolved": "https://registry.npmjs.org/react-onclickoutside/-/react-onclickoutside-6.12.2.tgz",
"integrity": "sha512-NMXGa223OnsrGVp5dJHkuKxQ4czdLmXSp5jSV9OqiCky9LOpPATn3vLldc+q5fK3gKbEHvr7J1u0yhBh/xYkpA==",
"funding": {
"type": "individual",
"url": "https://github.com/Pomax/react-onclickoutside/blob/master/FUNDING.md"
},
"peerDependencies": {
"react": "^15.5.x || ^16.x || ^17.x || ^18.x",
"react-dom": "^15.5.x || ^16.x || ^17.x || ^18.x"
}
},
"node_modules/react-popper": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/react-popper/-/react-popper-2.3.0.tgz",
"integrity": "sha512-e1hj8lL3uM+sgSR4Lxzn5h1GxBlpa4CQz0XLF8kx4MDrDRWY0Ena4c97PUeSX9i5W3UAfDP0z0FXCTQkoXUl3Q==",
"dependencies": {
"react-fast-compare": "^3.0.1",
"warning": "^4.0.2"
},
"peerDependencies": {
"@popperjs/core": "^2.0.0",
"react": "^16.8.0 || ^17 || ^18",
"react-dom": "^16.8.0 || ^17 || ^18"
}
},
"node_modules/react-redux": {
"node_modules/react-redux": {
"version": "8.0.4",
"version": "8.0.4",
"resolved": "https://registry.npmjs.org/react-redux/-/react-redux-8.0.4.tgz",
"resolved": "https://registry.npmjs.org/react-redux/-/react-redux-8.0.4.tgz",
...
@@ -17569,6 +17636,14 @@
...
@@ -17569,6 +17636,14 @@
"makeerror": "1.0.12"
"makeerror": "1.0.12"
}
}
},
},
"node_modules/warning": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/warning/-/warning-4.0.3.tgz",
"integrity": "sha512-rpJyN222KWIvHJ/F53XSZv0Zl/accqHR8et1kpaMTD/fLCRxtV8iX8czMzY7sVZupTI3zcUTg8eycS2kNF9l6w==",
"dependencies": {
"loose-envify": "^1.0.0"
}
},
"node_modules/watchpack": {
"node_modules/watchpack": {
"version": "2.4.0",
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz",
"resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz",
...
@@ -22790,6 +22865,11 @@
...
@@ -22790,6 +22865,11 @@
"resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.2.tgz",
"resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.2.tgz",
"integrity": "sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA=="
"integrity": "sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA=="
},
},
"classnames": {
"version": "2.3.2",
"resolved": "https://registry.npmjs.org/classnames/-/classnames-2.3.2.tgz",
"integrity": "sha512-CSbhY4cFEJRe6/GQzIk5qXZ4Jeg5pcsP7b5peFSDpffpe1cqjASH/n9UTjBwOp6XpMSTwQ8Za2K5V02ueA7Tmw=="
},
"clean-css": {
"clean-css": {
"version": "5.3.1",
"version": "5.3.1",
"resolved": "https://registry.npmjs.org/clean-css/-/clean-css-5.3.1.tgz",
"resolved": "https://registry.npmjs.org/clean-css/-/clean-css-5.3.1.tgz",
...
@@ -23298,6 +23378,11 @@
...
@@ -23298,6 +23378,11 @@
"whatwg-url": "^8.0.0"
"whatwg-url": "^8.0.0"
}
}
},
},
"date-fns": {
"version": "2.29.3",
"resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.29.3.tgz",
"integrity": "sha512-dDCnyH2WnnKusqvZZ6+jA1O51Ibt8ZMRNkDZdyAyK4YfbDwa/cEmuztzG5pk6hqlp9aSBPYcjOlktquahGwGeA=="
},
"dayjs": {
"dayjs": {
"version": "1.11.6",
"version": "1.11.6",
"resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.6.tgz",
"resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.6.tgz",
...
@@ -29181,6 +29266,19 @@
...
@@ -29181,6 +29266,19 @@
"whatwg-fetch": "^3.6.2"
"whatwg-fetch": "^3.6.2"
}
}
},
},
"react-datepicker": {
"version": "4.8.0",
"resolved": "https://registry.npmjs.org/react-datepicker/-/react-datepicker-4.8.0.tgz",
"integrity": "sha512-u69zXGHMpxAa4LeYR83vucQoUCJQ6m/WBsSxmUMu/M8ahTSVMMyiyQzauHgZA2NUr9y0FUgOAix71hGYUb6tvg==",
"requires": {
"@popperjs/core": "^2.9.2",
"classnames": "^2.2.6",
"date-fns": "^2.24.0",
"prop-types": "^15.7.2",
"react-onclickoutside": "^6.12.0",
"react-popper": "^2.2.5"
}
},
"react-dev-utils": {
"react-dev-utils": {
"version": "12.0.1",
"version": "12.0.1",
"resolved": "https://registry.npmjs.org/react-dev-utils/-/react-dev-utils-12.0.1.tgz",
"resolved": "https://registry.npmjs.org/react-dev-utils/-/react-dev-utils-12.0.1.tgz",
...
@@ -29281,11 +29379,31 @@
...
@@ -29281,11 +29379,31 @@
"resolved": "https://registry.npmjs.org/react-error-overlay/-/react-error-overlay-6.0.11.tgz",
"resolved": "https://registry.npmjs.org/react-error-overlay/-/react-error-overlay-6.0.11.tgz",
"integrity": "sha512-/6UZ2qgEyH2aqzYZgQPxEnz33NJ2gNsnHA2o5+o4wW9bLM/JYQitNP9xPhsXwC08hMMovfGe/8retsdDsczPRg=="
"integrity": "sha512-/6UZ2qgEyH2aqzYZgQPxEnz33NJ2gNsnHA2o5+o4wW9bLM/JYQitNP9xPhsXwC08hMMovfGe/8retsdDsczPRg=="
},
},
"react-fast-compare": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/react-fast-compare/-/react-fast-compare-3.2.0.tgz",
"integrity": "sha512-rtGImPZ0YyLrscKI9xTpV8psd6I8VAtjKCzQDlzyDvqJA8XOW78TXYQwNRNd8g8JZnDu8q9Fu/1v4HPAVwVdHA=="
},
"react-is": {
"react-is": {
"version": "17.0.2",
"version": "17.0.2",
"resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz",
"resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz",
"integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w=="
"integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w=="
},
},
"react-onclickoutside": {
"version": "6.12.2",
"resolved": "https://registry.npmjs.org/react-onclickoutside/-/react-onclickoutside-6.12.2.tgz",
"integrity": "sha512-NMXGa223OnsrGVp5dJHkuKxQ4czdLmXSp5jSV9OqiCky9LOpPATn3vLldc+q5fK3gKbEHvr7J1u0yhBh/xYkpA==",
"requires": {}
},
"react-popper": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/react-popper/-/react-popper-2.3.0.tgz",
"integrity": "sha512-e1hj8lL3uM+sgSR4Lxzn5h1GxBlpa4CQz0XLF8kx4MDrDRWY0Ena4c97PUeSX9i5W3UAfDP0z0FXCTQkoXUl3Q==",
"requires": {
"react-fast-compare": "^3.0.1",
"warning": "^4.0.2"
}
},
"react-redux": {
"react-redux": {
"version": "8.0.4",
"version": "8.0.4",
"resolved": "https://registry.npmjs.org/react-redux/-/react-redux-8.0.4.tgz",
"resolved": "https://registry.npmjs.org/react-redux/-/react-redux-8.0.4.tgz",
...
@@ -30889,6 +31007,14 @@
...
@@ -30889,6 +31007,14 @@
"makeerror": "1.0.12"
"makeerror": "1.0.12"
}
}
},
},
"warning": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/warning/-/warning-4.0.3.tgz",
"integrity": "sha512-rpJyN222KWIvHJ/F53XSZv0Zl/accqHR8et1kpaMTD/fLCRxtV8iX8czMzY7sVZupTI3zcUTg8eycS2kNF9l6w==",
"requires": {
"loose-envify": "^1.0.0"
}
},
"watchpack": {
"watchpack": {
"version": "2.4.0",
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz",
"resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz",
planner-front/src/components/Calendars/UI/DateTimePicker/DateTimePicker.js
0 → 100644
View file @
08779b92
import
React
,
{
useState
}
from
'react'
;
import
DatePicker
from
"react-datepicker"
;
const
DateTimePicker
=
({
task
,
name
,
onChange
})
=>
{
const
[
startDate
,
setStartDate
]
=
useState
(
new
Date
());
return
(
<>
<
DatePicker
selected
=
{
startDate
}
onChange
=
{(
date
)
=>
setStartDate
(
date
)}
// locale="ru"
showTimeSelect
timeFormat
=
"p"
timeIntervals
=
{
60
}
dateFormat
=
"Pp"
/>
<
/
>
);
};
export
default
DateTimePicker
;
planner-front/src/components/MyTasksCompoments/CustomTableCell.js
View file @
08779b92
...
@@ -25,9 +25,9 @@ const CustomTableCell = ({
...
@@ -25,9 +25,9 @@ const CustomTableCell = ({
flexDirection
:
"column"
,
flexDirection
:
"column"
,
fontSize
:
"12px"
,
fontSize
:
"12px"
,
};
};
if
(
name
===
'dateTimeDeadLine'
){
//
if (name==='dateTimeDeadLine'){
console
.
log
(
'dateTimeDeadLine '
,
name
,
' '
,
value
)
//
console.log('dateTimeDeadLine ', name, ' ', value)
}
//
}
const
divTwoStyle
=
{
const
divTwoStyle
=
{
display
:
"flex"
,
display
:
"flex"
,
...
...
planner-front/src/components/MyTasksCompoments/DateTimePicker/DateTimePicker.js
View file @
08779b92
import
*
as
React
from
"react"
;
import
React
,
{
useState
}
from
"react"
;
import
TextField
from
"@mui/material/TextField"
;
import
TextField
from
"@mui/material/TextField"
;
import
{
LocalizationProvider
}
from
"@mui/x-date-pickers/LocalizationProvider"
;
import
{
LocalizationProvider
}
from
"@mui/x-date-pickers/LocalizationProvider"
;
import
{
DateTimePicker
}
from
"@mui/x-date-pickers/DateTimePicker"
;
import
{
DateTimePicker
}
from
"@mui/x-date-pickers/DateTimePicker"
;
import
{
AdapterMoment
}
from
"@mui/x-date-pickers/AdapterMoment"
;
import
{
AdapterMoment
}
from
"@mui/x-date-pickers/AdapterMoment"
;
import
{
AdapterDayjs
}
from
'@mui/x-date-pickers/AdapterDayjs'
;
import
moment
from
"moment"
;
export
default
function
MaterialUIPickers
(
props
)
{
export
default
function
MaterialUIPickers
({
task
,
name
,
onChange
,
})
{
const
[
state
,
setState
]
=
useState
(
null
)
let
fullYear
=
new
Date
().
getFullYear
()
let
month
=
new
Date
().
getMonth
()
let
day
=
new
Date
().
getDate
();
console
.
log
(
'datepicker inside task'
,
task
,
'state '
,
state
)
return
(
return
(
<
LocalizationProvider
<
LocalizationProvider
dateAdapter
=
{
AdapterMoment
}
dateAdapter
=
{
AdapterMoment
}
sx
=
{{
width
:
"100%"
,
fontSize
:
5
,
fontWeight
:
"200"
}}
sx
=
{{
width
:
"100%"
,
fontSize
:
5
,
fontWeight
:
"200"
}}
adapterLocale
=
{
'ru-RU'
}
>
>
<
DateTimePicker
<
DateTimePicker
inputFormat
=
"DD-MM-YY kk:mm A"
minTime
=
{
moment
({
year
:
fullYear
,
month
:
month
,
day
:
day
,
hour
:
11
,
minute
:
0
})}
disabled
=
{
props
.
task
.
readOnly
}
maxTime
=
{
moment
({
year
:
fullYear
,
month
:
month
,
day
:
day
,
hour
:
20
,
minute
:
0
})}
renderInput
=
{(
params
)
=>
(
disablePast
=
{
true
}
showTimeSelect
=
{
true
}
minutesStep
=
{
60
}
ampm
=
{
false
}
ampmInClock
=
{
false
}
inputFormat
=
"DD/MM/YY HH:mm"
disabled
=
{
task
.
readOnly
}
renderInput
=
{(
params
)
=>
{
return
(
<
TextField
<
TextField
{...
params
}
{...
params
}
sx
=
{{
width
:
"auto"
,
fontWeight
:
"200"
,
fontSize
:
5
}}
sx
=
{{
width
:
"auto"
,
fontWeight
:
"200"
,
fontSize
:
5
}}
name
=
{
props
.
name
}
name
=
{
name
}
/
>
/
>
)}
)}
}
value
=
{
props
.
task
[
props
.
name
]
}
value
=
{
state
}
onChange
=
{(
newValue
)
=>
{
onChange
=
{(
newValue
)
=>
{
props
.
onChange
(
props
.
task
.
id
,
newValue
,
props
.
name
);
setState
(
newValue
)
console
.
log
(
'newValue '
,
newValue
)
onChange
(
task
.
id
,
newValue
,
name
);
}}
}}
/
>
/
>
<
/LocalizationProvider
>
<
/LocalizationProvider
>
...
...
planner-front/src/components/MyTasksCompoments/NewTaskForm.js
View file @
08779b92
...
@@ -20,8 +20,11 @@ import MaterialUIPickers from "./DateTimePicker/DateTimePicker";
...
@@ -20,8 +20,11 @@ import MaterialUIPickers from "./DateTimePicker/DateTimePicker";
import
BasicSelect
from
"../UI/Select/Select"
;
import
BasicSelect
from
"../UI/Select/Select"
;
import
{
addTask
}
from
"../../store/actions/tasksActions"
;
import
{
addTask
}
from
"../../store/actions/tasksActions"
;
import
TaskModal
from
"./TaskModal/TaskModal"
;
import
TaskModal
from
"./TaskModal/TaskModal"
;
import
{
dateToISOLikeButLocal
}
from
'../../helpers/CalendarHelpers'
;
import
DateTimePicker
from
"../Calendars/UI/DateTimePicker/DateTimePicker"
;
export
default
function
NewTaskForm
({
projects
,
setAddTaskForm
})
{
export
default
function
NewTaskForm
({
projects
,
setAddTaskForm
})
{
console
.
log
(
'new task form'
)
const
dispatch
=
useDispatch
();
const
dispatch
=
useDispatch
();
const
user
=
useSelector
((
state
)
=>
state
.
users
.
user
);
const
user
=
useSelector
((
state
)
=>
state
.
users
.
user
);
const
currentDateTime
=
new
Date
();
const
currentDateTime
=
new
Date
();
...
@@ -71,15 +74,17 @@ export default function NewTaskForm({ projects, setAddTaskForm }) {
...
@@ -71,15 +74,17 @@ export default function NewTaskForm({ projects, setAddTaskForm }) {
};
};
const
onDateChange
=
(
id
,
value
,
property
)
=>
{
const
onDateChange
=
(
id
,
value
,
property
)
=>
{
cons
ole
.
log
(
'value '
,
value
,
'property '
,
property
)
cons
t
utcAvoidoffset
=
moment
(
value
).
utcOffset
(
0
,
true
).
format
(
)
const
newTask
=
{
const
newTask
=
{
...
task
,
...
task
,
[
property
]:
moment
.
parseZone
(
value
,
"DD/MM/YYYY"
,
true
).
format
(),
[
property
]:
utcAvoidoffset
,
// [property]: moment.parseZone(value, "DD/MM/YYYY", true).format(),
};
};
setTask
(
newTask
);
setTask
(
newTask
);
};
};
const
handleAddTask
=
()
=>
{
const
handleAddTask
=
()
=>
{
console
.
log
(
'handle task new form '
,
task
)
dispatch
(
addTask
(
task
));
dispatch
(
addTask
(
task
));
setAddTaskForm
();
setAddTaskForm
();
};
};
...
@@ -161,6 +166,7 @@ export default function NewTaskForm({ projects, setAddTaskForm }) {
...
@@ -161,6 +166,7 @@ export default function NewTaskForm({ projects, setAddTaskForm }) {
name
=
"dateTimeDeadLine"
name
=
"dateTimeDeadLine"
onChange
=
{
onDateChange
}
onChange
=
{
onDateChange
}
/
>
/
>
{
/* <DateTimePicker/> */
}
<
/TableCell
>
<
/TableCell
>
<
TableCell
style
=
{{
width
:
"5%"
}}
>
<
TableCell
style
=
{{
width
:
"5%"
}}
>
...
@@ -213,7 +219,7 @@ export const header = [
...
@@ -213,7 +219,7 @@ export const header = [
},
},
{
{
id
:
"dateTimeD
u
e"
,
id
:
"dateTimeD
eadLin
e"
,
numeric
:
true
,
numeric
:
true
,
disablePadding
:
false
,
disablePadding
:
false
,
label
:
"Дедлайн"
,
label
:
"Дедлайн"
,
...
...
planner-front/src/components/MyTasksCompoments/TableRowTask/TableRowTask.js
View file @
08779b92
...
@@ -161,13 +161,6 @@ const TableRowTask= ({
...
@@ -161,13 +161,6 @@ const TableRowTask= ({
/
>
/
>
{
task
.
isEditMode
&&
task
.
author
.
id
===
user
.
id
?
(
{
task
.
isEditMode
&&
task
.
author
.
id
===
user
.
id
?
(
<
TableCell
>
<
TableCell
>
{
/* <MaterialUIPickers
task={task}
name="dateTimeStart"
onChange={onDateChange}
user={user}
/> */
}
{
/* <TableCell> */
}
<
Tooltip
title
=
"Перейти в календарь"
>
<
Tooltip
title
=
"Перейти в календарь"
>
<
IconButton
<
IconButton
onClick
=
{()
=>
{
calendarOpen
(
task
.
id
)}}
onClick
=
{()
=>
{
calendarOpen
(
task
.
id
)}}
...
@@ -207,15 +200,13 @@ const TableRowTask= ({
...
@@ -207,15 +200,13 @@ const TableRowTask= ({
user
:
user
user
:
user
}}
>
}}
>
<
/CustomTableCell
>
<
/CustomTableCell
>
)}
)}
{
task
.
isEditMode
&&
task
.
author
.
id
===
user
.
id
?
(
{
task
.
isEditMode
&&
task
.
author
.
id
===
user
.
id
?
(
<
TableCell
>
<
TableCell
>
<
MaterialUIPickers
<
MaterialUIPickers
task
=
{
task
}
task
=
{
task
}
name
=
"dateTimeD
u
e"
name
=
"dateTimeD
eadLin
e"
onChange
=
{
onDateChange
}
onChange
=
{
onDateChange
}
user
=
{
user
}
user
=
{
user
}
/
>
/
>
...
...
planner-front/src/components/UI/Select/Select.js
View file @
08779b92
...
@@ -6,11 +6,11 @@ import FormControl from "@mui/material/FormControl";
...
@@ -6,11 +6,11 @@ import FormControl from "@mui/material/FormControl";
import
Select
from
"@mui/material/Select"
;
import
Select
from
"@mui/material/Select"
;
export
default
function
BasicSelect
({
value
,
label
,
name
,
onChange
,
task
,
items
})
{
export
default
function
BasicSelect
({
value
,
label
,
name
,
onChange
,
task
,
items
})
{
console
.
log
(
'select value '
,
value
)
//
console.log('select value ', value)
console
.
log
(
'select label '
,
label
)
//
console.log('select label ', label)
console
.
log
(
'select name '
,
name
)
//
console.log('select name ', name)
console
.
log
(
'select task '
,
task
)
//
console.log('select task ', task)
console
.
log
(
'select items '
,
items
)
//
console.log('select items ', items)
return
(
return
(
<
Box
sx
=
{{
minWidth
:
60
,
m
:
0
}}
>
<
Box
sx
=
{{
minWidth
:
60
,
m
:
0
}}
>
<
FormControl
fullWidth
>
<
FormControl
fullWidth
>
...
@@ -20,6 +20,7 @@ export default function BasicSelect({value,label,name,onChange,task,items}) {
...
@@ -20,6 +20,7 @@ export default function BasicSelect({value,label,name,onChange,task,items}) {
id
=
"demo-simple-select"
id
=
"demo-simple-select"
value
=
{
value
}
value
=
{
value
}
defaultValue
=
''
defaultValue
=
''
// displayEmpty={true}
label
=
{
label
}
label
=
{
label
}
name
=
{
name
}
name
=
{
name
}
onChange
=
{(
e
)
=>
onChange
(
e
,
task
)}
onChange
=
{(
e
)
=>
onChange
(
e
,
task
)}
...
...
planner-front/src/containers/MyTasks/MyTasks.js
View file @
08779b92
...
@@ -93,11 +93,17 @@ export default function EnhancedTable() {
...
@@ -93,11 +93,17 @@ export default function EnhancedTable() {
};
};
const
onDateChange
=
(
id
,
value
,
property
)
=>
{
const
onDateChange
=
(
id
,
value
,
property
)
=>
{
const
utcAvoidoffset
=
moment
(
value
).
utcOffset
(
0
,
true
).
format
()
if
(
property
===
'dateTimeDeadLine'
)
{
console
.
log
(
'In edit mode datedLine ad onDate '
,
value
)
}
const
newTasks
=
recievedTasks
.
map
((
task
)
=>
{
const
newTasks
=
recievedTasks
.
map
((
task
)
=>
{
if
(
task
.
id
===
id
)
{
if
(
task
.
id
===
id
)
{
return
{
return
{
...
task
,
...
task
,
[
property
]:
moment
.
parseZone
(
value
,
"DD/MM/YY"
,
true
).
format
(),
[
property
]:
utcAvoidoffset
,
// [property]: moment.parseZone(value, "DD/MM/YY", true).format(),
};
};
}
}
return
task
;
return
task
;
...
...
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