shift-org / shift-docs

Shift2Bikes: website and calendar for shift and pedalpalooza
https://shift2bikes.org
Other
22 stars 17 forks source link

fix: calendar "view more events" #738

Closed ionous closed 3 months ago

ionous commented 3 months ago

the comment was accurate, but the code was wrong:

// the next day to view is one day after the previous last
view.startdate = view.startdate.add(1, 'day');
view.startdate = view.enddate.add(1, 'day');

introduced with: https://github.com/shift-org/shift-docs/commit/9f7d7207f87644ce805f3e3dc35be600a9966ef5

the original code was:

firstDayOfRange = daysAfter(lastDayOfRange, nextDay);
lastDayOfRange = daysAfter(firstDayOfRange, dayRange);

to match, the code should be:

view.startdate = view.enddate.add(1, 'day');
view.enddate = view.startdate.add(dayRange, 'day');
carrythebanner commented 3 months ago

Hat tip to @AustinGil for the report!