Skip to content

Commit

Permalink
#4 [Fix] Calendar date format
Browse files Browse the repository at this point in the history
캘린더 기록 날짜 포맷 변경
issue: #4
  • Loading branch information
zhtmahthgus committed Jul 24, 2022
1 parent 761d529 commit 1ef3600
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/CustomCalendar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { StyledRoot, CalendarContainer, Image } from './style';

function CustomCalendar() {
const [value, onChange] = useState(new Date());
const mark = ['2022-07-07', '2022-07-10'];
const mark = ['20190707', '20220709', '20220710'];
return (
<StyledRoot>
<CalendarContainer>
Expand All @@ -23,15 +23,15 @@ function CustomCalendar() {
next2Label={null}
prev2Label={null}
tileClassName={({ date }) => {
if (mark.find(x => x === moment(date).format('YYYY-MM-DD'))) {
if (mark.find(x => x === moment(date).format('YYYYMMDD'))) {
return 'highlight';
}
return null;
}}
/* eslint-disable */
tileContent={({ date, view }) => {
const html = [];
if (mark.find(x => x === moment(date).format('YYYY-MM-DD'))) {
if (mark.find(x => x === moment(date).format('YYYYMMDD'))) {
html.push(
<NavLink key={0} to={`/MyPage/save/${date}`}>
<Image src={CalMoonCloud} alt="record" />
Expand Down

0 comments on commit 1ef3600

Please sign in to comment.