[WEB-3044] fix: Correct handling of equal start and end dates in cycle create and update (#6328)
* chore: handled start and end date issue when user send the start and end date equal * chore: updated variable name and comment * chore: typo
This commit is contained in:
parent
d3d3bf79f9
commit
0cabde03f0
4 changed files with 47 additions and 14 deletions
|
|
@ -21,11 +21,18 @@ class CycleWriteSerializer(BaseSerializer):
|
|||
and data.get("end_date", None) is not None
|
||||
):
|
||||
project_id = self.initial_data.get("project_id") or self.instance.project_id
|
||||
is_start_date_end_date_equal = (
|
||||
True if data.get("start_date") == data.get("end_date") else False
|
||||
)
|
||||
data["start_date"] = convert_to_utc(
|
||||
str(data.get("start_date").date()), project_id, is_start_date=True
|
||||
date=str(data.get("start_date").date()),
|
||||
project_id=project_id,
|
||||
is_start_date=True,
|
||||
)
|
||||
data["end_date"] = convert_to_utc(
|
||||
str(data.get("end_date", None).date()), project_id
|
||||
date=str(data.get("end_date", None).date()),
|
||||
project_id=project_id,
|
||||
is_start_date_end_date_equal=is_start_date_end_date_equal,
|
||||
)
|
||||
return data
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue