forked from github/plane
fix: date checker edge case fix (#443)
This commit is contained in:
parent
928ebdf632
commit
164072e3cc
@ -56,8 +56,7 @@ export const CycleForm: React.FC<Props> = ({ handleFormSubmit, handleClose, stat
|
|||||||
};
|
};
|
||||||
|
|
||||||
const cycleStatus =
|
const cycleStatus =
|
||||||
data?.start_date && data?.end_date
|
data?.start_date && data?.end_date ? getDateRangeStatus(data?.start_date, data?.end_date) : "";
|
||||||
? getDateRangeStatus(data?.start_date, data?.end_date) : "";
|
|
||||||
|
|
||||||
const dateChecker = async (payload: any) => {
|
const dateChecker = async (payload: any) => {
|
||||||
await cyclesService
|
await cyclesService
|
||||||
@ -141,7 +140,7 @@ export const CycleForm: React.FC<Props> = ({ handleFormSubmit, handleClose, stat
|
|||||||
value={value}
|
value={value}
|
||||||
onChange={(val) => {
|
onChange={(val) => {
|
||||||
onChange(val);
|
onChange(val);
|
||||||
watch("end_date") && cycleStatus != "current"
|
val && watch("end_date") && cycleStatus != "current"
|
||||||
? dateChecker({
|
? dateChecker({
|
||||||
start_date: val,
|
start_date: val,
|
||||||
end_date: watch("end_date"),
|
end_date: watch("end_date"),
|
||||||
@ -169,7 +168,7 @@ export const CycleForm: React.FC<Props> = ({ handleFormSubmit, handleClose, stat
|
|||||||
value={value}
|
value={value}
|
||||||
onChange={(val) => {
|
onChange={(val) => {
|
||||||
onChange(val);
|
onChange(val);
|
||||||
watch("start_date") && cycleStatus != "current"
|
val && watch("start_date") && cycleStatus != "current"
|
||||||
? dateChecker({
|
? dateChecker({
|
||||||
start_date: watch("start_date"),
|
start_date: watch("start_date"),
|
||||||
end_date: val,
|
end_date: val,
|
||||||
|
Loading…
Reference in New Issue
Block a user