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
butter-studio
Commits
eb9bcd78
Commit
eb9bcd78
authored
Aug 11, 2021
by
Kim, Subin
Browse files
Calender 수정 중
parent
566a6042
Changes
2
Show whitespace changes
Inline
Side-by-side
client/src/components/Calender/HorizontalCalender.js
View file @
eb9bcd78
...
@@ -7,6 +7,7 @@ import styles from "./calender.module.scss";
...
@@ -7,6 +7,7 @@ import styles from "./calender.module.scss";
const
Calender
=
({
selectDate
,
setSelectDate
})
=>
{
const
Calender
=
({
selectDate
,
setSelectDate
})
=>
{
const
[
dateList
,
setDateList
]
=
useState
([])
const
[
dateList
,
setDateList
]
=
useState
([])
const
[
dateArr
,
setDateArr
]
=
useState
([])
const
[
dateArr
,
setDateArr
]
=
useState
([])
const
[
date
,
setDate
]
=
useState
(
moment
().
format
(
'
YYYY-MM-DD
'
))
const
[
weekly
,
setWeekly
]
=
useState
([])
const
[
weekly
,
setWeekly
]
=
useState
([])
const
[
week
,
setWeek
]
=
useState
([
"
일
"
,
"
월
"
,
"
화
"
,
"
수
"
,
"
목
"
,
"
금
"
,
"
토
"
])
const
[
week
,
setWeek
]
=
useState
([
"
일
"
,
"
월
"
,
"
화
"
,
"
수
"
,
"
목
"
,
"
금
"
,
"
토
"
])
const
[
month
,
setMonth
]
=
useState
({
pre
:
moment
(
selectDate
).
subtract
(
1
,
'
months
'
).
format
(
'
YYYY-MM
'
),
cur
:
moment
(
selectDate
).
format
(
'
YYYY-MM
'
),
next
:
moment
(
selectDate
).
add
(
1
,
'
months
'
).
format
(
'
YYYY-MM
'
)
})
const
[
month
,
setMonth
]
=
useState
({
pre
:
moment
(
selectDate
).
subtract
(
1
,
'
months
'
).
format
(
'
YYYY-MM
'
),
cur
:
moment
(
selectDate
).
format
(
'
YYYY-MM
'
),
next
:
moment
(
selectDate
).
add
(
1
,
'
months
'
).
format
(
'
YYYY-MM
'
)
})
...
@@ -53,6 +54,8 @@ const Calender = ({ selectDate, setSelectDate }) => {
...
@@ -53,6 +54,8 @@ const Calender = ({ selectDate, setSelectDate }) => {
}
}
function
preWeek
()
{
function
preWeek
()
{
const
preDate
=
moment
(
date
).
week
()
console
.
log
(
"
week==
"
,
preDate
)
// let dateArr = []
// let dateArr = []
// dateArr = Array(7).fill(0).map((n, i) => {
// dateArr = Array(7).fill(0).map((n, i) => {
// let current = moment(oneDay).add((n + i), 'days')
// let current = moment(oneDay).add((n + i), 'days')
...
@@ -102,7 +105,7 @@ const Calender = ({ selectDate, setSelectDate }) => {
...
@@ -102,7 +105,7 @@ const Calender = ({ selectDate, setSelectDate }) => {
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
i
className
=
{
`col-1 bi bi-chevron-left align-self-center text-center
${
styles
.
cursor
}
`
}
onClick
=
{
preWeek
}
><
/i
>
<
i
className
=
{
`col-1 bi bi-chevron-left align-self-center text-center
${
styles
.
cursor
}
`
}
onClick
=
{
preWeek
}
><
/i
>
<
div
className
=
{
`d-flex justify-content-between col-10
${
styles
.
box
}
`
}
>
{
weekly
.
map
(
el
=>
el
)}
<
/div
>
<
div
className
=
{
`d-flex justify-content-between col-10
${
styles
.
box
}
`
}
>
{
dateList
.
map
(
el
=>
el
)}
<
/div
>
<
i
className
=
{
`col-1 bi bi-chevron-right align-self-center text-center
${
styles
.
cursor
}
`
}
onClick
=
{
nextWeek
}
><
/i
>
<
i
className
=
{
`col-1 bi bi-chevron-right align-self-center text-center
${
styles
.
cursor
}
`
}
onClick
=
{
nextWeek
}
><
/i
>
<
/div
>
<
/div
>
<
/
>
<
/
>
...
...
client/src/components/Calender/calender.module.scss
View file @
eb9bcd78
.box
{
.box
{
overflow
:
hidden
;
overflow
:
hidden
;
transform
:
translate3d
(
-420px
,
0px
,
0px
);
transition
:
all
0
.6s
ease
0s
;
&
.yearmonth
{
&
.yearmonth
{
position
:
relative
;
position
:
relative
;
...
...
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