Skip to content

Commit

Permalink
Revert round logic and detect last slot
Browse files Browse the repository at this point in the history
  • Loading branch information
TrySound committed Sep 12, 2019
1 parent 17b6cfd commit 02c2892
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/utils/TimeSlots.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,10 @@ export function getSlotMetrics({ min: start, max: end, step, timeslots }) {

const rangeStartMin = positionFromDate(rangeStart)
const rangeEndMin = positionFromDate(rangeEnd)
const top = (rangeStartMin / (step * numSlots)) * 100
const top =
rangeEndMin - rangeStartMin < step && !dates.eq(end, rangeEnd)
? ((rangeStartMin - step) / (step * numSlots)) * 100
: (rangeStartMin / (step * numSlots)) * 100

return {
top,
Expand Down

0 comments on commit 02c2892

Please sign in to comment.