diff --git a/packages/wow-ui/src/components/Picker/DateDropDown.tsx b/packages/wow-ui/src/components/Picker/DateDropDown.tsx index 656bc69a..454dfe47 100644 --- a/packages/wow-ui/src/components/Picker/DateDropDown.tsx +++ b/packages/wow-ui/src/components/Picker/DateDropDown.tsx @@ -29,7 +29,7 @@ const DateDropDown = ({ selectedValue, onClick, }: DateDropDownProps) => { - const findRenderString = () => { + const formatSelectedValue = () => { if (!selectedValue) return placeholder; if (mode === "range" && selectedValue.start) return selectedValue.start; if (mode === "single") return selectedValue; @@ -48,7 +48,7 @@ const DateDropDown = ({ type: selectedValue ? "selected" : "default", })} > - {findRenderString()} + {formatSelectedValue()} {mode === "range" && (
( }); }; - const changeNumberToStirng = (number: number) => { + const formatNumberToStirng = (number: number) => { return number.toString().padStart(2, "0"); }; - const changeTimeToString = (time: Time) => { + const formatTimeToString = (time: Time) => { const transformedHour = () => { if (time.hour === 0) return 12; if (time.hour > 12) return time.hour - 12; return time.hour; }; - const hour = changeNumberToStirng(transformedHour()); - const minute = changeNumberToStirng(time.minute); + const hour = formatNumberToStirng(transformedHour()); + const minute = formatNumberToStirng(time.minute); return { hour, minute }; }; - const strTime = changeTimeToString(selectedTime); + const strTime = formatTimeToString(selectedTime); return (