diff --git a/src/views/biz/parking/Regist.jsx b/src/views/biz/parking/Regist.jsx index 0c51eb6..c6e7132 100644 --- a/src/views/biz/parking/Regist.jsx +++ b/src/views/biz/parking/Regist.jsx @@ -97,6 +97,7 @@ const ParkingRegister = () => { }; alert(JSON.stringify(param)); setOpen(false); + // return false; opstBizService.saveSimsaTargetList(param).then((response) => { console.log(response); diff --git a/src/views/biz/parking/SaveParkingSimsaForm.jsx b/src/views/biz/parking/SaveParkingSimsaForm.jsx index e4675ed..0de9391 100644 --- a/src/views/biz/parking/SaveParkingSimsaForm.jsx +++ b/src/views/biz/parking/SaveParkingSimsaForm.jsx @@ -2,6 +2,7 @@ import { useState } from 'react'; import NumberFormat from 'react-number-format'; import format from 'date-fns/format'; +import getHours from 'date-fns/getHours'; import koLocale from 'date-fns/locale/ko'; import { Checkbox, FormControlLabel, Grid, Typography, TextField, MenuItem, Select, FormControl, InputLabel } from '@mui/material'; @@ -20,15 +21,16 @@ const teams = [ { code: '003', value: '3팀' }, { code: '004', value: '4팀' } ]; +const toDate = new Date(); const SaveParkingSimsaForm = ({ handleModalSave }) => { const [msuTeam, setMsuTeam] = useState(teams[0].code); - const [msSdate, setMsSdate] = useState(new Date()); - const [msStartsi, setMsStartsi] = useState('09'); - const [msEdate, setMsEdate] = useState(new Date()); + const [msSdate, setMsSdate] = useState(format(toDate, 'yyyy-MM-dd')); + const [msStartsi, setMsStartsi] = useState(getHours(toDate)); + const [msEdate, setMsEdate] = useState(format(toDate, 'yyyy-MM-dd')); const [msChasu, setMsChasu] = useState(); - const [msCdate, setMsCdate] = useState(new Date()); - const [msClosesi, setMsClosesi] = useState('09'); + const [msCdate, setMsCdate] = useState(format(toDate, 'yyyy-MM-dd')); + const [msClosesi, setMsClosesi] = useState(getHours(toDate)); const onSave = () => { handleModalSave({ @@ -36,7 +38,7 @@ const SaveParkingSimsaForm = ({ handleModalSave }) => { msSdate, msStartsi, msEdate, - msChasu: 99, + msChasu, msCdate, msClosesi }); @@ -72,7 +74,8 @@ const SaveParkingSimsaForm = ({ handleModalSave }) => { inputFormat="HH" mask="__" onChange={(newValue) => { - setMsStartsi(format(newValue, 'HH')); + // setMsStartsi(format(newValue, 'HH')); + setMsStartsi(getHours(newValue)); }} /> @@ -96,7 +99,7 @@ const SaveParkingSimsaForm = ({ handleModalSave }) => { - setMsuTeam(e.target.value)}> {teams.map((team, idx) => ( {team.value} @@ -108,7 +111,6 @@ const SaveParkingSimsaForm = ({ handleModalSave }) => { { format="######" fullWidth value={msChasu} - // onChange={setMsChasu} + onValueChange={(values) => setMsChasu(values.value)} /> @@ -146,7 +148,7 @@ const SaveParkingSimsaForm = ({ handleModalSave }) => { inputFormat="HH" mask="__" onChange={(newValue) => { - setMsClosesi(format(newValue, 'HH')); + setMsClosesi(getHours(newValue)); }} />