altinselimi / kalendar

Full featured, responsive, lightweight calendar in the browser.

Home Page:http://kalendar.altinselimi.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

adjusting split_value responsively

odelmas opened this issue · comments

Hi, I was wondering if I can upgrade the way split_value is handled recently.

Right now, in order to avoid problems in displaying appointments in my Calendar,
split_value is always equal to the greatest common divisor between my appointments durations.

Meaning if I have appointments with duration 15 min and another one with duration 20 min, split_value will equal 5 so all the appointments can be displayed without any error.

But this calculation is done globally among all my appointments, if I have 200 appointments with a duration of 20 minutes and 1 old appointment with a duration of 15 minutes, the split_value will still be 5, and it will be displayed like this for every day and every week shown in the calendar.

One way to enhance this that would be to calculate the geatest common divisor, not on all the appointments, but only on those that are displayed to the user. Thus the split_value would be calculated reactively to always match the greatest common divisor of the appointments displayed.

I saw that the component kalendar-week-view contains a computed property witch contains only the appointments displayed. Would it be possible to pass it via scoped-slots or events to parent component that contains the kalendar ?

I also saw that every time we change the week-view, there is a change event that is emitted. If the value of the dates that are displayed could be passed in this event, this could also be a way to retrieve info about dates that are actually displayed. So we can then calculate and optimise the split_value to be the greatest common divisor among the appointments that are showned.

BR

This issue should not happen in the new Kalendar version 2 since it handles all time durations.