Toggle navigation
Toggle navigation
This project
Loading...
Sign in
HyeonJun Jeon
/
Extended-Calendar
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
HyeonJun Jeon
2022-06-04 22:10:47 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
c024419ee201f541f2d93099c4eeb2170b21bb78
c024419e
1 parent
bce56861
[Style] Combine Grid/GridHead/Month
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
48 deletions
.gitignore
src/components/Grid.js
src/components/GridHead.js
src/components/Month.js
.gitignore
View file @
c024419
...
...
@@ -22,4 +22,4 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*
.prettierignore
server/libs/login
.pvdata
*
.pvdata
...
...
src/components/Grid.js
deleted
100644 → 0
View file @
bce5686
import
{
CalendarStateContext
}
from
"../pages/Calendar"
;
import
{
moveDate
,
toSunday
}
from
"../utils/Dates"
;
import
React
,
{
useContext
}
from
"react"
;
import
GridItem
from
"./GridItem.js"
;
const
Grid
=
()
=>
{
const
{
state
}
=
useContext
(
CalendarStateContext
);
const
renderItems
=
()
=>
{
const
items
=
[];
const
ndate
=
new
Date
(
state
.
date
);
ndate
.
setDate
(
1
);
toSunday
(
ndate
);
for
(
let
i
=
0
;
i
<
35
;
i
++
)
{
items
.
push
(
<
GridItem
key
=
{
i
}
targetDate
=
{
new
Date
(
ndate
)}
/>
)
;
moveDate
(
ndate
,
"day"
,
1
);
}
return
items
;
};
return
<
div
className
=
"Grid"
>
{
renderItems
()}
<
/div>
;
};
export
default
Grid
;
src/components/GridHead.js
deleted
100644 → 0
View file @
bce5686
const
GridHead
=
()
=>
{
const
days
=
[
"일"
,
"월"
,
"화"
,
"수"
,
"목"
,
"금"
,
"토"
];
const
renderItems
=
()
=>
{
const
items
=
[];
for
(
let
i
=
0
;
i
<
7
;
i
++
)
{
items
.
push
(
<
div
className
=
"GridHeadItem"
key
=
{
i
}
>
{
days
[
i
]}
<
/div
>
);
}
return
items
;
};
return
<
div
className
=
"GridHead"
>
{
renderItems
()}
<
/div>
;
};
export
default
GridHead
;
src/components/Month.js
View file @
c024419
import
Grid
from
"./Grid"
;
import
GridHead
from
"./GridHead"
;
import
React
,
{
useContext
}
from
"react"
;
import
GridItem
from
"./GridItem.js"
;
import
{
CalendarStateContext
}
from
"../pages/Calendar"
;
import
{
moveDate
,
toSunday
}
from
"../utils/Dates"
;
import
"../styles/Month.css"
;
const
GridHead
=
()
=>
{
const
days
=
[
"일"
,
"월"
,
"화"
,
"수"
,
"목"
,
"금"
,
"토"
];
const
renderItems
=
()
=>
{
const
items
=
[];
for
(
let
i
=
0
;
i
<
7
;
i
++
)
{
items
.
push
(
<
div
className
=
"GridHeadItem"
key
=
{
i
}
>
{
days
[
i
]}
<
/div
>
);
}
return
items
;
};
return
<
div
className
=
"GridHead"
>
{
renderItems
()}
<
/div>
;
};
const
Grid
=
()
=>
{
const
{
state
}
=
useContext
(
CalendarStateContext
);
const
renderItems
=
()
=>
{
const
items
=
[];
const
ndate
=
new
Date
(
state
.
date
);
ndate
.
setDate
(
1
);
toSunday
(
ndate
);
for
(
let
i
=
0
;
i
<
35
;
i
++
)
{
items
.
push
(
<
GridItem
key
=
{
i
}
targetDate
=
{
new
Date
(
ndate
)}
/>
)
;
moveDate
(
ndate
,
"day"
,
1
);
}
return
items
;
};
return
<
div
className
=
"Grid"
>
{
renderItems
()}
<
/div>
;
};
const
Month
=
()
=>
{
return
(
<
div
className
=
"Month"
>
...
...
Please
register
or
login
to post a comment