From 874d26d56ec1d107df5d2a3b5dadaddffde3ff3d Mon Sep 17 00:00:00 2001 From: minuk926 Date: Wed, 16 Mar 2022 16:48:09 +0900 Subject: [PATCH] =?UTF-8?q?build:=20moment=20->=20date-fns=EB=A1=9C=20?= =?UTF-8?q?=EB=8C=80=EC=B2=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 17 +++++++++++++++-- package.json | 2 -- src/views/biz/parking/Review.jsx | 10 ++++++++-- 3 files changed, 23 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 1e1ce54..388a96b 100755 --- a/README.md +++ b/README.md @@ -11,6 +11,16 @@ core-js 버전 3.3 미만은 유지보수가 안되니 사용하지 말라 # npx yarn-audit-fix ``` +### yarn install 실패시 : --force vs --legacy-peer-deps +```text +--force : 충돌 우회 +--legacy-peer-deps : 충돌 무시 +--force 시도 실패시 --legacy-peer-deps 실행 + +$ yarn install --force --network-timeout 6000000 +``` + + ### npm(yarn) install시 ECOCKETTIMEOUT 에러 ```shell npm(yarn) install --network-timeout 6000000 @@ -20,7 +30,7 @@ npm npm cache verify or npm cache clean --force yarn -yarn cache clean +yarn cache clean --force ``` ### useEffect, useMemo, useCallback lifeCycle @@ -71,4 +81,7 @@ useEffect(() => { ```text useRef : 클래스로 치면 멤버변수 혹은 dom객체 처럼 특정한 '값'만 기억해야 할 때 useMemo : 복잡한 함수의 'retur값'을 기억해야 할 때 -``` \ No newline at end of file +``` + +date-fns +moment \ No newline at end of file diff --git a/package.json b/package.json index b3bc5be..61e02aa 100755 --- a/package.json +++ b/package.json @@ -28,7 +28,6 @@ "chance": "^1.1.8", "core-js": "^3", "csstype": "^3.0.10", - "date-fns": "^2.28.0", "draft-js": "^0.11.7", "emoji-picker-react": "^3.5.1", "formik": "^2.2.9", @@ -39,7 +38,6 @@ "jwt-decode": "^3.1.2", "lodash": "^4.17.21", "material-ui-popup-state": "^2.0.0", - "moment": "^2.29.1", "prop-types": "^15.8.1", "react": "^17.0.2", "react-apexcharts": "^1.3.9", diff --git a/src/views/biz/parking/Review.jsx b/src/views/biz/parking/Review.jsx index 2543d82..435219a 100644 --- a/src/views/biz/parking/Review.jsx +++ b/src/views/biz/parking/Review.jsx @@ -1,6 +1,9 @@ import { useCallback, useEffect, useMemo, useState } from 'react'; import _ from 'lodash'; +import format from 'date-fns/format'; +import getYear from 'date-fns/getYear'; + // material-ui import { GridActionsCellItem } from '@mui/x-data-grid'; @@ -17,13 +20,16 @@ import MainCard from 'ui-component/cards/MainCard'; // project imports import MuiGridList from 'ui-component/MuiGridList'; import opstBizService from 'apis/OpstBizService'; -import moment from 'moment'; import { useTheme } from '@mui/material/styles'; import xitCmm from 'commons/XitCmm'; const ParkingReview = () => { const theme = useTheme(); - const toYear = Number(moment().format('YYYY')); + const year = getYear(new Date()); + console.log(`year = ${year}`); + console.log(year instanceof Date); + const toYear = Number(year); + console.log(`toYear = ${toYear}`); const years = _.range(toYear, toYear - 14, -1); const [selectedYear, setSelectedYear] = useState(toYear);