Tachyon icon indicating copy to clipboard operation
Tachyon copied to clipboard

EventTimeRanges shorter than 15min are drawn at the end of the Dayview

Open ahorovit opened this issue 5 years ago • 1 comments

I found the issue in DayView.java::setEventRects():

            int filteredStartMinute = Math.max(startMinute, timeRange.startMinute); 
            int duration = Math.min(endMinute, timeRange.endMinute) - filteredStartMinute;
            if (duration < MIN_DURATION_MINUTES) {
                duration = MIN_DURATION_MINUTES;
                filteredStartMinute = endMinute - duration;
            }

MIN_DURATION_MINUTES is 15min and endMinute is 11:59pm, so if duration is ever less than the minimum, it is drawn as a DirectionalRect from 11:44pm - 11:59pm.

I may be misinterpreting the intention here, but I suspect that filteredStartMinute should be reassigned relative to the timeRange.endMinute, not this.endMinute. IE:

            if (duration < MIN_DURATION_MINUTES) {
                duration = MIN_DURATION_MINUTES;
                filteredStartMinute = timeRange.endMinute - duration;
            }

ahorovit avatar Oct 05 '20 01:10 ahorovit

See my PR for a fix here: https://github.com/linkedin/Tachyon/pull/13

ahorovit avatar Oct 05 '20 02:10 ahorovit