From 2d1a0042f74a6fe85aa5e408eb1dd3066efbaf72 Mon Sep 17 00:00:00 2001 From: Rosyid Haryadi Date: Sun, 1 Oct 2023 14:34:37 +0700 Subject: upd: minTime maxTime makes it annoying to input, invalid time handled in result instead --- src/App.jsx | 23 ++++++++++++++++------- src/Entry.jsx | 4 ++-- src/Result.jsx | 10 ++++++++++ 3 files changed, 28 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/App.jsx b/src/App.jsx index a53e59b..db340da 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -7,13 +7,15 @@ import SalaryInput from "./SalaryInput.jsx"; import Result from "./Result.jsx"; import RemoveCircleIcon from '@mui/icons-material/RemoveCircle'; import AddCircleIcon from '@mui/icons-material/AddCircle'; +import Icon from '@mdi/react'; +import { mdiGitlab } from '@mdi/js'; function App() { const [baseSalary, setBaseSalary] = useState(0); const [listEntry, setListEntry] = useState( [ - {id: 0, date: dayjs(), start: dayjs(), finish: dayjs()}, + {id: 0, date: dayjs(), start: dayjs().set('hour', 17).set('minute', 30), finish: dayjs().set('hour', 18).set('minute', 30)}, ] ); const [removeDisabled, setRemoveDisabled] = useState(false); @@ -125,12 +127,19 @@ function App() {
  • Belum termasuk versi 6 hari kerja (todo)
  • UI belum responsive (todo)
  • - - Source - - - Rosyid - +
    + + + +
    diff --git a/src/Entry.jsx b/src/Entry.jsx index c486680..6c57903 100644 --- a/src/Entry.jsx +++ b/src/Entry.jsx @@ -22,7 +22,7 @@ function Entry({propId, propDate, propStart, propFinish, handleEntryChange}) { { setStart(newStart); handleEntryChange({id: propId, start: newStart}, 'start') @@ -31,7 +31,7 @@ function Entry({propId, propDate, propStart, propFinish, handleEntryChange}) { { setFinish(newFinish); handleEntryChange({id: propId, finish: newFinish}, 'finish') diff --git a/src/Result.jsx b/src/Result.jsx index dd977c5..3ba9a4e 100644 --- a/src/Result.jsx +++ b/src/Result.jsx @@ -9,6 +9,16 @@ function Result({listEntry, baseSalary}) { setTotalOvertimePay(getOvertimePayTotal(listEntry, baseSalary)); }, [listEntry, baseSalary]); + if (totalOvertimePay < 0) { + return ( + + + Waktu selesai mendahului waktu mulai. Mohon diperbaiki input. + + + ) + } + return ( -- cgit v1.2.3-70-g09d2