Skip to content
Snippets Groups Projects
Verified Commit bce6b8f6 authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Fix datetime handling

parent 6586e6cc
No related branches found
No related tags found
1 merge request!310Resolve "Implement Vue substitution frontend"
......@@ -2,7 +2,8 @@
<base-calendar-feed-details
v-bind="$props"
:color="currentSubject ? currentSubject.colour_bg : null"
>
without-location
>
<template #title>
<div
:style="{
......@@ -232,9 +233,8 @@ export default {
return {
...item,
amends: this.selectedEvent.meta.id,
// LessonEvent has datetime in UTC & graphql does not like the Z timezone info
datetimeStart: this.selectedEvent.start.toISOString().replace("Z", ""),
datetimeEnd: this.selectedEvent.end.toISOString().replace("Z", ""),
datetimeStart: this.selectedEvent.startDateTime.toISO(),
datetimeEnd: this.selectedEvent.endDateTime.toISO(),
};
},
transformPatchData(item) {
......
......@@ -73,21 +73,6 @@ class AmendLessonCreateMutation(DjangoCreateMutation):
"comment",
)
@classmethod
def handle_datetime_start(cls, value, name, info) -> int:
value = value.replace(tzinfo=timezone.utc)
return value
@classmethod
def handle_datetime_end(cls, value, name, info) -> int:
value = value.replace(tzinfo=timezone.utc)
return value
@classmethod
def before_save(cls, root, info, input, obj):
obj.timezone = obj.amends.timezone
return obj
class AmendLessonPatchMutation(DjangoPatchMutation):
class Meta:
......@@ -95,20 +80,6 @@ class AmendLessonPatchMutation(DjangoPatchMutation):
permissions = ("chronos.edit_substitution_rule",)
only_fields = ("subject", "teachers", "groups", "rooms", "cancelled", "comment")
@classmethod
def handle_datetime_start(cls, value, name, info) -> int:
value = value.replace(tzinfo=timezone.utc)
return value
@classmethod
def handle_datetime_end(cls, value, name, info) -> int:
value = value.replace(tzinfo=timezone.utc)
return value
@classmethod
def before_save(cls, root, info, input, id, obj):
obj.timezone = obj.amends.timezone
return obj
class TimetableType(graphene.Enum):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment