diff --git a/package.json b/package.json
index 397c087..f6e5378 100644
--- a/package.json
+++ b/package.json
@@ -17,6 +17,7 @@
"prop-types": "^15.7.2",
"qs": "^6.10.2",
"react": "^17.0.2",
+ "react-datepicker": "^4.5.0",
"react-dom": "^17.0.2",
"react-redux": "^7.2.6",
"react-router-dom": "^6.0.2",
diff --git a/src/common/utils/getTodayDate.jsx b/src/common/utils/getDateStr.jsx
similarity index 60%
rename from src/common/utils/getTodayDate.jsx
rename to src/common/utils/getDateStr.jsx
index 75dc4d4..9be2f31 100644
--- a/src/common/utils/getTodayDate.jsx
+++ b/src/common/utils/getDateStr.jsx
@@ -1,15 +1,16 @@
-const getTodayDate = () => {
- let today = new Date();
+const getDateStr = (date) => {
+ let today = new Date(date);
+
let dd = today.getDate();
let mm = today.getMonth() + 1;
let yyyy = today.getFullYear();
if (dd < 10) {
- dd += '0';
+ dd = '0' + dd;
}
if (mm < 10) {
- mm += '0';
+ mm = '0' + mm;
}
today = `${yyyy}-${mm}-${dd}`;
@@ -17,4 +18,4 @@ const getTodayDate = () => {
return today;
};
-export default getTodayDate;
+export default getDateStr;
diff --git a/src/common/utils/getDateValidate.jsx b/src/common/utils/getDateValidate.jsx
new file mode 100644
index 0000000..0140a24
--- /dev/null
+++ b/src/common/utils/getDateValidate.jsx
@@ -0,0 +1,41 @@
+const getDateValidate = (date) => {
+ let checkDate = new Date(date);
+ let today = new Date();
+
+ let dd1 = checkDate.getDate();
+ let mm1 = checkDate.getMonth() + 1;
+ let yyyy1 = checkDate.getFullYear();
+
+ let dd2 = today.getDate();
+ let mm2 = today.getMonth() + 1;
+ let yyyy2 = today.getFullYear();
+ console.log(dd1);
+ console.log(mm1);
+ if (dd1 < 10) {
+ dd1 = '0' + dd1;
+ }
+
+ if (mm1 < 10) {
+ mm1 = '0' + mm1;
+ }
+
+ if (dd2 < 10) {
+ dd2 = '0' + dd2;
+ }
+
+ if (mm2 < 10) {
+ mm2 = '0' + mm1;
+ }
+
+ checkDate = `${yyyy1}-${mm1}-${dd1}`;
+ today = `${yyyy2}-${mm2}-${dd2}`;
+ console.log(checkDate);
+ console.log(today);
+ // 지정 날짜가 현재 날짜 보다 크면 에러 발생 유도
+ const result = checkDate > today;
+ console.log(result);
+
+ return result;
+};
+
+export default getDateValidate;
diff --git a/src/components/domain/DiaryCreateStepOne/index.jsx b/src/components/domain/DiaryCreateStepOne/index.jsx
index 2e291e6..48e0c39 100644
--- a/src/components/domain/DiaryCreateStepOne/index.jsx
+++ b/src/components/domain/DiaryCreateStepOne/index.jsx
@@ -1,6 +1,11 @@
import styled from '@emotion/styled';
+import { css } from '@emotion/react';
import font from '@assets/fonts';
-import { Input } from '@components/base';
+import DatePicker from 'react-datepicker';
+import { ko } from 'date-fns/esm/locale';
+import color from '@assets/colors';
+
+import 'react-datepicker/dist/react-datepicker.css';
const Container = styled.div`
margin-top: 80px;
@@ -13,23 +18,41 @@ const Title = styled.span`
${font.heading_24};
`;
+const InputStyle = css`
+ display: block;
+ width: 100%;
+ box-sizing: border-box;
+ border: none;
+ border-bottom: 1px solid ${color.brown};
+ background-color: transparent;
+ color: ${color.black};
+ outline: none;
+ ${font.content_18};
+
+ &::placeholder {
+ color: ${color.grey};
+ }
+`;
+
const ErrorText = styled.span`
margin-top: 5px;
font-size: 14px;
color: red;
`;
-const DiaryCreateStepOne = ({ onChange, date, dateError, getTodayDate }) => {
+const DiaryCreateStepOne = ({ date, setDate, dateError }) => {
return (
날짜를 선택해주세요.
- setDate(date)}
+ placeholderText="일기 기록 날짜를 입력해주세요 !"
+ selected={date}
+ maxDate={new Date()}
/>
{dateError && {dateError}}
diff --git a/src/components/domain/DiaryImages/index.jsx b/src/components/domain/DiaryImages/index.jsx
index 5c38202..c3e44a3 100644
--- a/src/components/domain/DiaryImages/index.jsx
+++ b/src/components/domain/DiaryImages/index.jsx
@@ -45,13 +45,7 @@ const DiaryImages = ({ images }) => {
{images.map((image, index) => (
-
+
))}
diff --git a/src/components/domain/Header/index.jsx b/src/components/domain/Header/index.jsx
index b2c13e3..10c2c25 100644
--- a/src/components/domain/Header/index.jsx
+++ b/src/components/domain/Header/index.jsx
@@ -14,7 +14,6 @@ const HeaderContainer = styled.header`
z-index: 5;
top: 0;
left: 0;
- right: 0;
width: 100%;
height: 70px;
justify-content: center;
@@ -25,11 +24,10 @@ const HeaderContainer = styled.header`
`;
const HeaderContent = styled.div`
- display: -webkit-flex;
display: flex;
- justify-content: space-between;
- -webkit-flex: 1;
flex: 1;
+ width: 100%;
+ margin: 0;
justify-content: ${({ align }) => align};
`;
@@ -65,7 +63,7 @@ const Header = ({
{leftComponent}
{centerComponent}
- {rightComponent}
+ {rightComponent}
);
};
@@ -91,7 +89,6 @@ export const MainHeader = ({ groupTitle, familyMotto, role }) => {
>
}
- centerComponent={''}
rightComponent={