Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Navigation breaks with custom view duration longer than dateIncrement #5319

Closed
acerix opened this issue Mar 24, 2020 · 8 comments
Closed

Navigation breaks with custom view duration longer than dateIncrement #5319

acerix opened this issue Mar 24, 2020 · 8 comments
Assignees
Labels
Confirmed View Date Range Customization about which dates/times are displayed
Milestone

Comments

@acerix
Copy link
Member

acerix commented Mar 24, 2020

Reported in https://fullcalendar.freshdesk.com/a/tickets/1522

Clicking "prev" doesn't work the second time and "next" should move forward by the duration but only goes 1 week.

https://codepen.io/acerix/pen/PoqyJwb?editable=true&editors=001

Works by setting dateIncrement to the same as duration manually.

@ghry5
Copy link

ghry5 commented Apr 14, 2020

Did you find a workaround?
I am having the exact problem with any dateIncrement set to smaller than duration.

@acerix acerix changed the title Navigation breaks with custom view duration longer than dateAlignment Navigation breaks with custom view duration longer than dateIncrement May 7, 2020
@acerix
Copy link
Member Author

acerix commented May 7, 2020

It seems like that is the same issue, demo with dateIncrement < duration:

https://codepen.io/acerix/pen/gOavVNr?editors=0010

The only workaround I could find it to replace next/prev with custom buttons.

@janswist
Copy link

janswist commented Jul 7, 2020

It seems like that is the same issue, demo with dateIncrement > duration:

https://codepen.io/acerix/pen/gOavVNr?editors=0010

The only workaround I could find it to replace next/prev with custom buttons.

So there are no plans on fixing this any soon?

@stefgodin
Copy link

I had the same problem in my app, trying to make a custom 2 days grid (named dayGridTwoDays) view with only 1 day increment.

Here is my temporary fix with custom button, keeping native functionality with multiple views allowed.

    customButtons: {
        prev: {
            click: function() {
                var api = FullCalendar.getApi();
                if(api.view.type === 'dayGridTwoDays'){
                    api.changeView('dayGrid'); //Switch to one day view
                    api.prev(); //Set to previous day
                    api.changeView('dayGridTwoDays'); //Switch back to 2 days view
                }
                else{
                    api.prev();
                }
            }
        },
        next: {
            click: function() {
                var api = FullCalendar.getApi();
                if(api.view.type === 'dayGridTwoDays'){
                    api.changeView('dayGrid'); //Switch to one day view
                    api.next(); //Set to next day
                    api.changeView('dayGridTwoDays'); //Switch back to 2 days view
                }
                else{
                    api.next();
                }
            }
        }
    }

Please note that I am using Vue adapter so FullCalendar.getApi(); is actually vm.$refs.fullCalendar.getApi();.

@fabianosanttana
Copy link

Any update for this issue?

@dhruvaraj-jaiswal
Copy link

prev and next navigation is not working for me as well :(

@acerix
Copy link
Member Author

acerix commented Apr 27, 2021

For reference, here's a workaround for a year-long view with 6 month increment:

https://codepen.io/acerix/pen/vYgMxvO?editors=001

@arshaw
Copy link
Member

arshaw commented Jun 16, 2021

this fix has been released in v5.8.0

upgraded repro:
https://codepen.io/arshaw/pen/WNpLBPO?editors=0010

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Confirmed View Date Range Customization about which dates/times are displayed
Projects
None yet
Development

No branches or pull requests

7 participants