Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
students
Today KU
Commits
7e58d2ea
Commit
7e58d2ea
authored
Oct 31, 2021
by
Kim, Subin
Browse files
AdminMonthly Calendar 수정 완료
parent
1597a87c
Changes
2
Show whitespace changes
Inline
Side-by-side
client/src/components/Calendar/AdminMonthly.js
View file @
7e58d2ea
...
...
@@ -96,7 +96,6 @@ const AdminMonthly = () => {
}
}}
dateClick
=
{({
dateStr
})
=>
{
console
.
log
(
"
dateStr==
"
,
dateStr
)
setDateShow
({
...
dateShow
,
date
:
dateStr
,
show
:
true
})
return
<
button
type
=
"
button
"
className
=
"
btn btn-primary
"
data
-
bs
-
toggle
=
"
modal
"
data
-
bs
-
target
=
"
#scheduleModal
"
><
/button
>
}}
...
...
client/src/components/Modal/DatePickerModal.js
View file @
7e58d2ea
import
{
useState
,
useEffect
}
from
"
react
"
;
import
moment
from
'
moment
'
;
const
DatePickerModal
=
({
initialDate
,
changeDate
,
setChangeDate
,
s
how
,
setShow
})
=>
{
const
DatePickerModal
=
({
initialDate
,
changeDate
,
setChangeDate
,
pickerS
how
,
set
Picker
Show
})
=>
{
const
[
date
,
setDate
]
=
useState
({
year
:
moment
(
changeDate
).
get
(
'
year
'
),
month
:
moment
(
changeDate
).
get
(
'
month
'
)
+
1
})
const
[
year
,
setYear
]
=
useState
({
start
:
moment
(
initialDate
).
get
(
'
year
'
)
-
3
,
end
:
moment
(
initialDate
).
get
(
'
year
'
)
+
3
})
const
month
=
moment
(
initialDate
).
get
(
'
month
'
)
+
1
...
...
@@ -32,7 +32,7 @@ const DatePickerModal = ({ initialDate, changeDate, setChangeDate, show, setShow
function
cancel
()
{
setDate
({
year
:
moment
(
changeDate
).
get
(
'
year
'
),
month
:
moment
(
changeDate
).
get
(
'
month
'
)
+
1
})
setShow
(
false
)
set
Picker
Show
(
false
)
}
function
handleClick
()
{
...
...
@@ -41,26 +41,26 @@ const DatePickerModal = ({ initialDate, changeDate, setChangeDate, show, setShow
else
{
let
dateStr
=
date
.
year
+
"
-
"
+
date
.
month
+
"
-01
"
setChangeDate
(
moment
(
dateStr
).
format
(
"
YYYY-MM-DD
"
))
setShow
(
false
)
set
Picker
Show
(
false
)
}
}
else
if
(
date
.
year
===
year
.
end
)
{
if
(
month
<
date
.
month
)
alert
(
"
선택하신 날짜는 유효하지 않습니다. 다시 선택해주세요.
"
)
else
{
let
dateStr
=
date
.
year
+
"
-
"
+
date
.
month
+
"
-01
"
setChangeDate
(
moment
(
dateStr
).
format
(
"
YYYY-MM-DD
"
))
setShow
(
false
)
set
Picker
Show
(
false
)
}
}
else
{
let
dateStr
=
date
.
year
+
"
-
"
+
date
.
month
+
"
-01
"
setChangeDate
(
moment
(
dateStr
).
format
(
"
YYYY-MM-DD
"
))
setShow
(
false
)
set
Picker
Show
(
false
)
}
}
return
(
<>
{
s
how
?
<
div
className
=
"
offcanvas-backdrop fade show
"
><
/div> : null
}
<
div
className
=
{
"
offcanvas offcanvas-bottom
"
+
(
s
how
?
"
visible show
"
:
"
invisiblel
"
)}
tabIndex
=
"
-1
"
id
=
"
datePicker
"
aria
-
labelledby
=
"
datePicker
"
>
{
pickerS
how
?
<
div
className
=
"
offcanvas-backdrop fade show
"
><
/div> : null
}
<
div
className
=
{
"
offcanvas offcanvas-bottom
"
+
(
pickerS
how
?
"
visible show
"
:
"
invisiblel
"
)}
tabIndex
=
"
-1
"
id
=
"
datePicker
"
aria
-
labelledby
=
"
datePicker
"
>
<
div
className
=
"
offcanvas-body small py-2
"
>
<
div
className
=
"
d-flex my-3
"
>
<
div
className
=
"
col-6 d-flex flex-column justify-content-between align-items-center fs-4
"
>
...
...
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