mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-20 13:32:00 +00:00
feat(FE-Storyless): add date input for transfer date in MovementForm
This commit is contained in:
@@ -8,6 +8,7 @@ import { Icon } from '@iconify/react';
|
|||||||
import Button from '@/components/Button';
|
import Button from '@/components/Button';
|
||||||
import TextInput from '@/components/input/TextInput';
|
import TextInput from '@/components/input/TextInput';
|
||||||
import NumberInput from '@/components/input/NumberInput';
|
import NumberInput from '@/components/input/NumberInput';
|
||||||
|
import DateInput from '@/components/input/DateInput';
|
||||||
import SelectInput, {
|
import SelectInput, {
|
||||||
OptionType,
|
OptionType,
|
||||||
useSelect,
|
useSelect,
|
||||||
@@ -309,6 +310,10 @@ const MovementForm = ({ type = 'add', initialValues }: MovementFormProps) => {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleTransferDateChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
|
formik.setFieldValue('transfer_date', e.target.value);
|
||||||
|
};
|
||||||
|
|
||||||
// ===== EVENT HANDLERS =====
|
// ===== EVENT HANDLERS =====
|
||||||
// Product Handlers
|
// Product Handlers
|
||||||
const addProduct = () => {
|
const addProduct = () => {
|
||||||
@@ -821,13 +826,12 @@ const MovementForm = ({ type = 'add', initialValues }: MovementFormProps) => {
|
|||||||
errorMessage={formik.errors.transfer_reason}
|
errorMessage={formik.errors.transfer_reason}
|
||||||
readOnly={type === 'detail'}
|
readOnly={type === 'detail'}
|
||||||
/>
|
/>
|
||||||
<TextInput
|
<DateInput
|
||||||
required
|
required
|
||||||
label='Tanggal Transfer'
|
label='Tanggal Transfer'
|
||||||
type='date'
|
|
||||||
name='transfer_date'
|
name='transfer_date'
|
||||||
value={formik.values.transfer_date}
|
value={formik.values.transfer_date}
|
||||||
onChange={formik.handleChange}
|
onChange={handleTransferDateChange}
|
||||||
onBlur={formik.handleBlur}
|
onBlur={formik.handleBlur}
|
||||||
isError={
|
isError={
|
||||||
formik.touched.transfer_date &&
|
formik.touched.transfer_date &&
|
||||||
|
|||||||
Reference in New Issue
Block a user