Я новичок в дизайне муравьев. У меня есть форма с двумя сборщиками даты. Дата выпуска и срок действия. Я хочу иметь возможность ограничить выбор даты для даты истечения срока не ранее даты выпуска. Это мой подход до сих пор.
<Form.Item
label="Issue Date"
name={["userIdentification", "identification_issue_date"]}
rules={[
{
required: true,
message: REQUIRED_ERROR_MESSAGE,
},
]}
>
<DatePicker
disabledDate={(current) =>
current && current > moment()
}
/>
</Form.Item>
<Form.Item
label="Expiry Date"
name={[
"userIdentification",
"identification_expiry_date",
]}
dependencies={[
"userIdentification",
"identification_issue_date",
]}
rules={[
{
required: true,
message: REQUIRED_ERROR_MESSAGE,
},
({ getFieldValue }) => ({
validator(_, value) {
console.log(
"fields value from issue_date",
getFieldValue([
"userIdentification",
"identification_issue_date",
])
);
if (!value && getFieldValue("allocation") === "") {
return Promise.reject(REQUIRED_ERROR_MESSAGE);
}
return Promise.resolve();
},
}),
]}
>
<DatePicker
disabledDate={(current) =>
current && current > moment()
}
/>
</Form.Item>
Любая помощь будет сильно оценена