Compare commits
No commits in common. "4495e414b5ee7b3094eb51a70a1cf222a0d82d47" and "7a71b7e98a47e5090396338a2c74477fd05c08a2" have entirely different histories.
4495e414b5
...
7a71b7e98a
|
|
@ -84,20 +84,8 @@ export const ModernDatePicker: React.FC<ModernDatePickerProps> = ({ label, value
|
|||
};
|
||||
|
||||
const handleConfirm = () => {
|
||||
// 날짜 순서 자동 정렬
|
||||
let finalValue = { ...tempValue };
|
||||
|
||||
if (finalValue.from && finalValue.to) {
|
||||
// from이 to보다 나중이면 swap
|
||||
if (finalValue.from > finalValue.to) {
|
||||
const temp = finalValue.from;
|
||||
finalValue.from = finalValue.to;
|
||||
finalValue.to = temp;
|
||||
}
|
||||
}
|
||||
|
||||
// 확인 버튼을 눌렀을 때만 onChange 호출
|
||||
onChange(finalValue);
|
||||
onChange(tempValue);
|
||||
setIsOpen(false);
|
||||
setSelectingType("from");
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue