Revert "Potential resolution to date time issues post 4pm."
This reverts commit e79b9f9084.
This commit is contained in:
@@ -23,21 +23,20 @@ export function FormDatePicker({
|
||||
onChange,
|
||||
onBlur,
|
||||
onlyFuture,
|
||||
isDateOnly = true,
|
||||
...restProps
|
||||
}) {
|
||||
const ref = useRef();
|
||||
|
||||
const handleChange = (newDate) => {
|
||||
if (value !== newDate && onChange) {
|
||||
onChange(isDateOnly ? newDate && newDate.format("YYYY-MM-DD") : newDate);
|
||||
onChange(newDate);
|
||||
}
|
||||
};
|
||||
|
||||
const handleKeyDown = (e) => {
|
||||
if (e.key.toLowerCase() === "t") {
|
||||
if (onChange) {
|
||||
onChange(isDateOnly ? moment().format("YYYY-MM-DD") : moment());
|
||||
onChange(moment());
|
||||
// if (ref.current && ref.current.blur) ref.current.blur();
|
||||
}
|
||||
} else if (e.key.toLowerCase() === "enter") {
|
||||
@@ -65,8 +64,7 @@ export function FormDatePicker({
|
||||
});
|
||||
}
|
||||
|
||||
if (_a.isValid() && onChange)
|
||||
onChange(isDateOnly ? _a.format("YYYY-MM-DD") : _a);
|
||||
if (_a.isValid() && onChange) onChange(_a);
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
@@ -26,7 +26,6 @@ const DateTimePicker = (
|
||||
value={value}
|
||||
onBlur={onBlur}
|
||||
onChange={onChange}
|
||||
isDateOnly={false}
|
||||
/>
|
||||
|
||||
<TimePicker
|
||||
|
||||
Reference in New Issue
Block a user