Fakultas Ilmu Komputer UI

Commit f21848e2 authored by wulanmantiri's avatar wulanmantiri
Browse files

[REFACTOR] Fix datepicker bug for default value

parent 93eaf3e8
......@@ -18,7 +18,9 @@ const Datepicker: FC<Props> = ({
}) => {
const [show, setShow] = useState(false);
const onPress = () => setShow(true);
const onPress = () => {
setShow(true);
};
const handleChange = (_: any, date?: Date) => {
setShow(false);
......@@ -42,7 +44,7 @@ const Datepicker: FC<Props> = ({
) : null}
{show ? (
<RNDateTimePicker
value={value}
value={new Date(value)}
onChange={handleChange}
locale="id-ID"
/>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment