Skip to content

Commit

Permalink
[WEB-3087] fix: handle cycle start and end timezone conversion in lis…
Browse files Browse the repository at this point in the history
…t, create, and update (#6366)

* chore: handled cycle start and start timezone conversion in list, create and update

* chore: yarn lock
  • Loading branch information
gurusainath authored Jan 9, 2025
1 parent add35b5 commit 2ddd709
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion apiserver/plane/app/serializers/cycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def validate(self, data):
):
project_id = (
self.initial_data.get("project_id", None)
or (self.instance and self.instance.get("project_id", None))
or (self.instance and self.instance.project_id)
or self.context.get("project_id", None)
)
is_start_date_end_date_equal = (
Expand Down
10 changes: 10 additions & 0 deletions apiserver/plane/app/views/cycle/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,11 @@ def create(self, request, slug, project_id):
.first()
)

datetime_fields = ["start_date", "end_date"]
cycle = user_timezone_converter(
cycle, datetime_fields, request.user.user_timezone
)

# Send the model activity
model_activity.delay(
model_name="cycle",
Expand Down Expand Up @@ -387,6 +392,11 @@ def partial_update(self, request, slug, project_id, pk):
"created_by",
).first()

datetime_fields = ["start_date", "end_date"]
cycle = user_timezone_converter(
cycle, datetime_fields, request.user.user_timezone
)

# Send the model activity
model_activity.delay(
model_name="cycle",
Expand Down

0 comments on commit 2ddd709

Please sign in to comment.