Skip to content

Commit

Permalink
Update Timetable.vue
Browse files Browse the repository at this point in the history
  • Loading branch information
Thiritin authored Aug 17, 2023
1 parent a3cfc4f commit 56770ec
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions resources/js/Timetable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const props = defineProps({
})
const schedule = ref(props.initialSchedule)
const currentTime = ref(new Date());
Echo.channel('ScreenAll')
.listen('.schedule.update', (e) => {
Expand All @@ -38,6 +39,11 @@ const groupedSchedule = computed(() => {
// Group by date
return schedule.value
.filter((entry) => {
const now = currentTime.value;
const start = new Date(entry.starts_at);
const end = new Date(new Date(entry.ends_at).getTime() + (entry.delay * 1000 * 60));
return (end.getDate() >= now.getDate() || start.getDate() >= now.getDate())
return true;
})
.filter((entry) => {
Expand Down

0 comments on commit 56770ec

Please sign in to comment.