From b273e34ac8561ebe09f067eed7b582a3086aedc7 Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Thu, 9 Oct 2025 15:35:00 +0530 Subject: [PATCH] fix: live class issues --- frontend/src/components/LiveClass.vue | 10 +++++++--- lms/lms/doctype/lms_live_class/lms_live_class.py | 4 ++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/LiveClass.vue b/frontend/src/components/LiveClass.vue index aae328c8..34ab5627 100644 --- a/frontend/src/components/LiveClass.vue +++ b/frontend/src/components/LiveClass.vue @@ -54,8 +54,8 @@
- {{ formatTime(cls.time) }} - - {{ dayjs(getClassEnd(cls)).format('HH:mm A') }} + {{ dayjs(getClassStart(cls)).format('hh:mm A') }} - + {{ dayjs(getClassEnd(cls)).format('hh:mm A') }}
{ return true } +const getClassStart = (cls) => { + return new Date(`${cls.date}T${cls.time}`) +} + const getClassEnd = (cls) => { - const classStart = new Date(`${cls.date}T${cls.time}`) + const classStart = getClassStart(cls) return new Date(classStart.getTime() + cls.duration * 60000) } diff --git a/lms/lms/doctype/lms_live_class/lms_live_class.py b/lms/lms/doctype/lms_live_class/lms_live_class.py index 2f77eef1..5a54c56a 100644 --- a/lms/lms/doctype/lms_live_class/lms_live_class.py +++ b/lms/lms/doctype/lms_live_class/lms_live_class.py @@ -38,8 +38,12 @@ class LMSLiveClass(Document): def add_event_participants(self, event, calendar): participants = frappe.get_all("LMS Batch Enrollment", {"batch": self.batch_name}, pluck="member") + instructors = frappe.get_all("Course Instructor", {"parent": self.batch_name}, pluck="instructor") participants.append(frappe.session.user) + participants.extend(instructors) + participants = list(set(participants)) + for participant in participants: frappe.get_doc( {