From fd61907ad806d73ba2ce8c568ee4ce2aeb7e34b0 Mon Sep 17 00:00:00 2001 From: hamo-o Date: Tue, 27 Aug 2024 06:07:44 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20format~=20=EC=9C=BC=EB=A1=9C=20?= =?UTF-8?q?=ED=95=A8=EC=88=98=20=EB=84=A4=EC=9D=B4=EB=B0=8D=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/wow-ui/src/components/Picker/DateDropDown.tsx | 4 ++-- packages/wow-ui/src/components/Picker/TimePicker.tsx | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) 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 (