From 63633dcd62e72a6c55533b50949630ed8d554328 Mon Sep 17 00:00:00 2001
From: Rosyid Haryadi <rosyid_haryadi@protonmail.com>
Date: Sat, 30 Sep 2023 14:21:44 +0700
Subject: initial commit

---
 src/Entry.jsx | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)
 create mode 100644 src/Entry.jsx

(limited to 'src/Entry.jsx')

diff --git a/src/Entry.jsx b/src/Entry.jsx
new file mode 100644
index 0000000..e554050
--- /dev/null
+++ b/src/Entry.jsx
@@ -0,0 +1,29 @@
+import {useState} from "react";
+import {DatePicker, LocalizationProvider, TimePicker} from '@mui/x-date-pickers';
+import {AdapterDayjs} from '@mui/x-date-pickers/AdapterDayjs';
+import 'dayjs/locale/id';
+
+
+function Entry({propDate, propStart, propFinish}) {
+    const [date, setDate] = useState(propDate);
+    const [start, setStart] = useState(propStart);
+    const [finish, setFinish] = useState(propFinish);
+
+    return (
+        <LocalizationProvider dateAdapter={AdapterDayjs} adapterLocale='id'>
+            <div style={{display: 'flex', gap: '5px'}}>
+                <DatePicker label="Tanggal Lembur" value={date}
+                            onAccept={(newDate) => setDate(newDate)}/>
+                <TimePicker label="Mulai" ampm={false} value={start} maxTime={finish} onAccept={(newStart) => {
+                    setStart(newStart)
+                }}/>
+                <TimePicker label="Selesai" ampm={false} value={finish} minTime={start} onAccept={(newFinish) => {
+                    setFinish(newFinish);
+                    console.log(newFinish)
+                }}/>
+            </div>
+        </LocalizationProvider>
+    )
+}
+
+export default Entry;
\ No newline at end of file
-- 
cgit v1.2.3-70-g09d2

