From 8b072b9f290bc2b0538e145d9515b3da945c7db1 Mon Sep 17 00:00:00 2001 From: Lim Jonguk Date: Wed, 16 Mar 2022 17:14:26 +0900 Subject: [PATCH] =?UTF-8?q?build:=20=ED=8C=A8=ED=82=A4=EC=A7=80=20?= =?UTF-8?q?=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 10 ++++++++-- package.json | 1 + src/views/biz/parking/Review.jsx | 12 ++++-------- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 388a96b..dd8af0b 100755 --- a/README.md +++ b/README.md @@ -82,6 +82,12 @@ useEffect(() => { useRef : 클래스로 치면 멤버변수 혹은 dom객체 처럼 특정한 '값'만 기억해야 할 때 useMemo : 복잡한 함수의 'retur값'을 기억해야 할 때 ``` +### typeof : primitive type string return vs instanceof +```js +'undefined' | 'boolean' | 'number' | 'string' | 'object' | 'function' -date-fns -moment \ No newline at end of file +typeof 변수명 +typeof 변수명 === 'object' + +변수명 instanceof 클래스 +``` \ No newline at end of file diff --git a/package.json b/package.json index 61e02aa..c64322e 100755 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "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", diff --git a/src/views/biz/parking/Review.jsx b/src/views/biz/parking/Review.jsx index 435219a..2de8ba3 100644 --- a/src/views/biz/parking/Review.jsx +++ b/src/views/biz/parking/Review.jsx @@ -4,7 +4,6 @@ import _ from 'lodash'; import format from 'date-fns/format'; import getYear from 'date-fns/getYear'; - // material-ui import { GridActionsCellItem } from '@mui/x-data-grid'; import { Divider, Grid, InputAdornment, MenuItem, OutlinedInput, Select } from '@mui/material'; @@ -26,13 +25,10 @@ import xitCmm from 'commons/XitCmm'; const ParkingReview = () => { const theme = useTheme(); 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); + console.log(typeof year); + const years = _.range(year, year - 14, -1); - const [selectedYear, setSelectedYear] = useState(toYear); + const [selectedYear, setSelectedYear] = useState(year); const [searchTxt, setSearchTxt] = useState(''); const [totalCount, setTotalCount] = useState(0); @@ -138,7 +134,7 @@ const ParkingReview = () => { - setSelectedYear(e.target.value)}> {years.map((year, idx) => ( {year}