Apexal / late

A web app for RPI students to manage their course load.
https://www.late.work
MIT License
54 stars 19 forks source link

Fixed issue #530 #557

Closed tobiasjpark closed 4 years ago

tobiasjpark commented 4 years ago

Fixes #530

Proposed Changes

NOTE: I was unable to test whether this code fully works due to another bug which caused a 500 Internal Server Error (I believe it involves fullcalendar?); I notified @Apexal about this. After that bug is fixed, this code should be tested to verify that it works (and if it doesn't, further commits will be needed before approving this pull request).

Apexal commented 4 years ago

I'll test this ASAP and approve it if it works :)

Apexal commented 4 years ago

It appears that event.start and this.currentTerm.classesEnd are different sorts of date objects.

Also to make sure that this works everywhere we use the mixin, specifically assessment work schedules, place it at the very very start of the eventRendermethod:

eventRender ({ event, el, view }) {
  if (event.extendedProps.eventType === 'course') {
    // Prevent classes from showing up after the end of classes
    if (moment(event.start).isAfter(this.currentTerm.classesEnd)) {
      return false
    }
  }
  // ------------

  if (event.rendering === 'background') return
  // ...
}
tobiasjpark commented 4 years ago

@Apexal Thanks! I think I fixed it.