diff --git a/frontend/src/views/coordinator/EditSchedule.tsx b/frontend/src/views/coordinator/EditSchedule.tsx
index 99ac15e..7938b7b 100644
--- a/frontend/src/views/coordinator/EditSchedule.tsx
+++ b/frontend/src/views/coordinator/EditSchedule.tsx
@@ -1,3 +1,4 @@
+import { DateTime } from 'luxon'
import { useState } from 'react'
import { Controller, NestedValue, useForm } from 'react-hook-form'
import { useMutation, useQuery } from 'react-query'
@@ -65,41 +66,66 @@ const EditSchedule = ({
}
return (
-
+
)
diff --git a/frontend/src/views/coordinator/Schedule.tsx b/frontend/src/views/coordinator/Schedule.tsx
index 6949a45..11e651a 100644
--- a/frontend/src/views/coordinator/Schedule.tsx
+++ b/frontend/src/views/coordinator/Schedule.tsx
@@ -66,11 +66,12 @@ const Schedule = () => {
}) => {
return {
id,
- title: `Obrona ${group?.name ?? ''}`,
+ title: `${group?.name ?? '-'}`,
start: new Date(start_date),
end: new Date(end_date),
resource: {
committee,
+ group,
},
}
},
@@ -153,6 +154,20 @@ const Schedule = () => {
}
}
+ const eventGetter = (event: any) => {
+ return event?.resource?.group
+ ? {
+ style: {
+ backgroundColor: '#3174ad',
+ },
+ }
+ : {
+ style: {
+ backgroundColor: '#329f32',
+ },
+ }
+ }
+
return (
)
diff --git a/frontend/src/views/student/StudentSchedule.tsx b/frontend/src/views/student/StudentSchedule.tsx
index 490f8f6..46ce58a 100644
--- a/frontend/src/views/student/StudentSchedule.tsx
+++ b/frontend/src/views/student/StudentSchedule.tsx
@@ -69,11 +69,12 @@ const StudentSchedule = () => {
}) => {
return {
id,
- title: `Obrona ${group?.name ?? ''}`,
+ title: `${group?.name ?? '-'}`,
start: new Date(start_date),
end: new Date(end_date),
resource: {
committee,
+ group,
},
}
},
@@ -107,6 +108,20 @@ const StudentSchedule = () => {
}
const onSubmit = async (data: any) => {}
+ const eventGetter = (event: any) => {
+ return event?.resource?.group
+ ? {
+ style: {
+ backgroundColor: '#3174ad',
+ },
+ }
+ : {
+ style: {
+ backgroundColor: '#329f32',
+ },
+ }
+ }
+
return (
@@ -122,6 +137,9 @@ const StudentSchedule = () => {
events={events}
onView={onView}
view={view}
+ eventPropGetter={eventGetter}
+ min={DateTime.fromObject({ hour: 8, minute: 0 }).toJSDate()}
+ max={DateTime.fromObject({ hour: 16, minute: 0 }).toJSDate()}
/>