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 =
|
||||
data?.start_date && data?.end_date
|
||||
? getDateRangeStatus(data?.start_date, data?.end_date) : "";
|
||||
data?.start_date && data?.end_date ? getDateRangeStatus(data?.start_date, data?.end_date) : "";
|
||||
|
||||
const dateChecker = async (payload: any) => {
|
||||
await cyclesService
|
||||
@ -141,7 +140,7 @@ export const CycleForm: React.FC<Props> = ({ handleFormSubmit, handleClose, stat
|
||||
value={value}
|
||||
onChange={(val) => {
|
||||
onChange(val);
|
||||
watch("end_date") && cycleStatus != "current"
|
||||
val && watch("end_date") && cycleStatus != "current"
|
||||
? dateChecker({
|
||||
start_date: val,
|
||||
end_date: watch("end_date"),
|
||||
@ -169,7 +168,7 @@ export const CycleForm: React.FC<Props> = ({ handleFormSubmit, handleClose, stat
|
||||
value={value}
|
||||
onChange={(val) => {
|
||||
onChange(val);
|
||||
watch("start_date") && cycleStatus != "current"
|
||||
val && watch("start_date") && cycleStatus != "current"
|
||||
? dateChecker({
|
||||
start_date: watch("start_date"),
|
||||
end_date: val,
|
||||
|
Loading…
Reference in New Issue
Block a user