Merge pull request #1766 from pateljannat/issues-135
fix: live class issues
This commit is contained in:
@@ -54,8 +54,8 @@
|
|||||||
<div class="flex items-center space-x-2">
|
<div class="flex items-center space-x-2">
|
||||||
<Clock class="w-4 h-4 stroke-1.5" />
|
<Clock class="w-4 h-4 stroke-1.5" />
|
||||||
<span>
|
<span>
|
||||||
{{ formatTime(cls.time) }} -
|
{{ dayjs(getClassStart(cls)).format('hh:mm A') }} -
|
||||||
{{ dayjs(getClassEnd(cls)).format('HH:mm A') }}
|
{{ dayjs(getClassEnd(cls)).format('hh:mm A') }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
@@ -181,8 +181,12 @@ const canAccessClass = (cls) => {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const getClassStart = (cls) => {
|
||||||
|
return new Date(`${cls.date}T${cls.time}`)
|
||||||
|
}
|
||||||
|
|
||||||
const getClassEnd = (cls) => {
|
const getClassEnd = (cls) => {
|
||||||
const classStart = new Date(`${cls.date}T${cls.time}`)
|
const classStart = getClassStart(cls)
|
||||||
return new Date(classStart.getTime() + cls.duration * 60000)
|
return new Date(classStart.getTime() + cls.duration * 60000)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -38,8 +38,12 @@ class LMSLiveClass(Document):
|
|||||||
|
|
||||||
def add_event_participants(self, event, calendar):
|
def add_event_participants(self, event, calendar):
|
||||||
participants = frappe.get_all("LMS Batch Enrollment", {"batch": self.batch_name}, pluck="member")
|
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.append(frappe.session.user)
|
||||||
|
participants.extend(instructors)
|
||||||
|
participants = list(set(participants))
|
||||||
|
|
||||||
for participant in participants:
|
for participant in participants:
|
||||||
frappe.get_doc(
|
frappe.get_doc(
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user