@@ -19,7 +19,7 @@ import ViewMonth from './view/Month';
1919import { addLeadingZero } from '../utils/string' ;
2020import useOutsideClick from '../hooks/useOutsideClick' ;
2121
22- interface Iprops {
22+ interface IProps {
2323 initValue ?: Date | null ;
2424 isClearButton ?: boolean ;
2525 isMultipleCalendar ?: boolean ;
@@ -35,7 +35,7 @@ function Datepicker({
3535 valueFormat = 'YYYY-MM-DD' ,
3636 labelFormat = 'YYYY / MM' ,
3737 onChange,
38- } : Iprops ) {
38+ } : IProps ) {
3939 // 인수가 없을 땐 LOCAL 기준 현재 시간을 반환한다.
4040 const NEW_DATE = new Date ( ) ;
4141 const [ value , setValue ] = useState < Date | null > ( initValue ) ;
@@ -61,8 +61,8 @@ function Datepicker({
6161 value : string | number ,
6262 type : 'year' | 'month' | 'date'
6363 ) => {
64- type Tsplit = string | number ;
65- const split = viewDate . split ( '-' ) as [ Tsplit , Tsplit , Tsplit ] ;
64+ type TSplit = string | number ;
65+ const split : TSplit [ ] = viewDate . split ( '-' ) ;
6666 const valueNum = Number ( value ) ;
6767
6868 if ( type === 'year' ) {
@@ -84,7 +84,7 @@ function Datepicker({
8484 } else {
8585 split [ 1 ] = valueNum ;
8686 }
87- split [ 1 ] = addLeadingZero ( split [ 1 ] ) ;
87+ split [ 1 ] = addLeadingZero ( split [ 1 ] as string ) ;
8888 }
8989 if ( type === 'date' ) split [ 2 ] = addLeadingZero ( valueNum ) ;
9090
0 commit comments