@@ -10,7 +10,7 @@ import { COLORS, DATE_FORMAT, DEFAULT_COLOR, LANGUAGE } from "../constants";
1010import DatepickerContext from "../contexts/DatepickerContext" ;
1111import { formatDate , nextMonth , previousMonth } from "../helpers" ;
1212import useOnClickOutside from "../hooks" ;
13- import { Period , DatepickerType , ColorKeys } from "../types" ;
13+ import { Period , DatepickerType , ColorKeys , PeriodDay } from "../types" ;
1414
1515import { Arrow , VerticalDash } from "./utils" ;
1616
@@ -65,7 +65,7 @@ const Datepicker: React.FC<DatepickerType> = ({
6565
6666 const [ hour , setHour ] = useState < string > ( "1" ) ;
6767 const [ minute , setMinute ] = useState < string > ( "00" ) ;
68- const [ periodDay , setPeriodDay ] = useState < "AM" | "PM" > ( "PM" ) ;
68+ const [ periodDay , setPeriodDay ] = useState < PeriodDay > ( "PM" ) ;
6969
7070 // Custom Hooks use
7171 useOnClickOutside ( containerRef , ( ) => {
@@ -108,7 +108,7 @@ const Datepicker: React.FC<DatepickerType> = ({
108108 setMinute ( minute ) ;
109109 } , [ ] ) ;
110110
111- const changePeriodDay = useCallback ( ( periodDay : "AM" | "PM" ) => {
111+ const changePeriodDay = useCallback ( ( periodDay : PeriodDay ) => {
112112 setPeriodDay ( periodDay ) ;
113113 } , [ ] ) ;
114114
@@ -282,6 +282,9 @@ const Datepicker: React.FC<DatepickerType> = ({
282282 changeInputText : ( newText : string ) => setInputText ( newText ) ,
283283 updateFirstDate : ( newDate : dayjs . Dayjs ) => firstGotoDate ( newDate ) ,
284284 changeDatepickerValue : onChange ,
285+ hour,
286+ minute,
287+ periodDay,
285288 changeHour,
286289 changeMinute,
287290 changePeriodDay,
@@ -319,6 +322,9 @@ const Datepicker: React.FC<DatepickerType> = ({
319322 dayHover ,
320323 inputText ,
321324 onChange ,
325+ hour ,
326+ minute ,
327+ periodDay ,
322328 changeHour ,
323329 changeMinute ,
324330 changePeriodDay ,
0 commit comments