Prev button not working in custom dayGrid view when dateIncrement is shorter than duration
See original GitHub issueI am using v 4.0.2
This is the code for my custom view : ` document.addEventListener(‘DOMContentLoaded’, function () { var calendarEl = document.getElementById(‘calendar’);
var calendar = new FullCalendar.Calendar(calendarEl, {
plugins: ['interaction', 'dayGrid', 'timeGrid'],
defaultView: 'dayGridTwoWeeks',
views: {
dayGridTwoWeeks: {
type: 'dayGrid',
duration: {weeks: 2},
dateIncrement:{weeks:1},
visibleRange: function (currentDate) {
return {
start: moment(currentDate).startOf('week').toDate(),
end: moment(currentDate).endOf('week').toDate()
};
},
}
},
firstDay: 1,
calendar.render();
});
` I basically want a two week view with the ability to shift weekwise. While this works very well for advancing a week, the previous button gets broken after one use.
When clicking on the next button, I can go back again. But still only one week, so once I move 4 weeks in the future, I can only return to 3 weeks in the future.
Moreover, the today button does not work when I move one week back.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:15 (4 by maintainers)
Top Results From Across the Web
Multi-Month View with different duration and dateIncrement ...
Next button works fine, but clicking the prev button triggers event loading twice. On the first time the calender steps 6-month backwards the ......
Read more >@fullcalendar/daygrid | Yarn - Package Manager
prev button doesn't work when previous days are hidden by hiddenDays and dayCount is greater than dateIncrement (#4202) calendar locale not used in...
Read more >Calendar widget - GitHub Gist
Calendar widget. GitHub Gist: instantly share code, notes, and snippets.
Read more >fullcalendar-view--3109717-4.patch - Drupal
+// By default, all elements that are shorter than the recommended height are expanded uniformly, not considering +// any other els that are ......
Read more >0003-add-calendar-cell-static-files-16393.patch - Combo
stale calendar title when navigate away from then back to the a view ... dateIncrement not working when duration and dateIncrement have different...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Its a bit of a fudge but you should be able to achieve it with the below code additions. Bootstrap plugin is required for the chevron but you could use special characters. Hope it helps
Hello,
I have a similar problem using the plugin timeGrid in v4.2.0
I basically want to display a 3 weeks calendar with the ability to shift forward and backward by one week. It works fine when moving forward but moving backward works only the first time. Afterward, if you click on the next buttons, you move 2 weeks forward.
Here an example to demonstrate the problem : https://codepen.io/capablanca4/pen/Ybgwyw
To reproduce the problem first select the 3 weeks view (3 week button), click on the next, and then twice on the previous button.
How to avoid this bug ?