Grible / timetable.js

Vanilla javascript plugin for building nice responsive timetables
http://timetablejs.org
GNU General Public License v3.0
395 stars 110 forks source link

Events starting before the beginning of the timetable not showing #20

Open misterdev opened 7 years ago

misterdev commented 7 years ago

The problem is very similar to this one https://github.com/Grible/timetable.js/issues/9 If the event starts before the beginning of the timetable startTime, the event is not displayed.

The problem is caused by getDurationHours in computeEventBlockOffset, that is not day aware. getDurationHours is used to calculate the block offset, if my event starts at 8:00 and the timeline scope starts at 9:00 it should return a negative offset (-1h), but it returns the offset of an event starting at 9:00 and ending at 8:00 of the later day (+23h).

jrobind commented 6 years ago

Just noticed this issue as well.

Is it intended for events added to still be pushed to the events array? Even if the event times do not correspond with the timeline scope?

Could there be a check to prevent users from adding events outside of the set scope for the timeline?