@@ -19,7 +19,7 @@ import ViewMonth from './view/Month';
19
19
import { addLeadingZero } from '../utils/string' ;
20
20
import useOutsideClick from '../hooks/useOutsideClick' ;
21
21
22
- interface Iprops {
22
+ interface IProps {
23
23
initValue ?: Date | null ;
24
24
isClearButton ?: boolean ;
25
25
isMultipleCalendar ?: boolean ;
@@ -35,7 +35,7 @@ function Datepicker({
35
35
valueFormat = 'YYYY-MM-DD' ,
36
36
labelFormat = 'YYYY / MM' ,
37
37
onChange,
38
- } : Iprops ) {
38
+ } : IProps ) {
39
39
// 인수가 없을 땐 LOCAL 기준 현재 시간을 반환한다.
40
40
const NEW_DATE = new Date ( ) ;
41
41
const [ value , setValue ] = useState < Date | null > ( initValue ) ;
@@ -61,8 +61,8 @@ function Datepicker({
61
61
value : string | number ,
62
62
type : 'year' | 'month' | 'date'
63
63
) => {
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 ( '-' ) ;
66
66
const valueNum = Number ( value ) ;
67
67
68
68
if ( type === 'year' ) {
@@ -84,7 +84,7 @@ function Datepicker({
84
84
} else {
85
85
split [ 1 ] = valueNum ;
86
86
}
87
- split [ 1 ] = addLeadingZero ( split [ 1 ] ) ;
87
+ split [ 1 ] = addLeadingZero ( split [ 1 ] as string ) ;
88
88
}
89
89
if ( type === 'date' ) split [ 2 ] = addLeadingZero ( valueNum ) ;
90
90
0 commit comments