Skip to content

Fix 'next week' button in the week's view

Slawek Kaplonski requested to merge work/slaweq/issue/186 into master

When going to the next week in the week's view, it wasn't working at all if next week was also begining of the next month. It seems that it was because of the Math.floor() method used to calculate weekDiff - this method returns always returns integer lower or equal to the input argument. As calculated value was something like 0.99, Math.floor() returned 0 so there was no change of the week at all.

This patch changes it to use Math.round() which rounds input value to the closest integer value so it should works better in that case.

Closes-issue: #186 (closed)

Merge request reports

Loading