My favorites | Sign in
Project Home Issues
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 2445: Custom views, easily customize prev/next duration jump
1 person starred this issue and may be notified of changes. Back to list
Status:  ExportedToGithub
Owner:  ----
Closed:  Aug 2015


Sign in to add a comment
 
Reported by war...@gmail.com, Feb 17, 2015
I have an issue, think it started in 2.2.6 and still doesn't work in 2.2.7.

I have a custom view:


setDefaults({
    fixedWeekCount: true,
	twoWeekNavJump: 1
});

var TwoWeeks = fcViews.twoweeks = BasicView.extend({
    
});
TwoWeeks.duration = { 'weeks': 2 };


Works great (i know, could do even easier now with settings, but I need custom navigation).

I need for the prev/next navigation to move 1 week at a time.
This worked for awhile:

    initialize: function() {
        // subclasses can implement
        var navJump = this.opt('twoWeekNavJump');
        if (navJump) {
            this.intervalDuration = moment.duration({"week": navJump});
        }
    }

that stopped working, so I tried to modify the:
computePrevDate, and computeNextDate in the same way, find 'twoWeekNavJump' option, if found, change the duration to that number of weeks.

Works fine for prev.

However, NEXT doesn't work: I believe because the next date will be already visible, so it doesn't re-draw on the first click, but the second when the date moves beyond the view.

How can I get the next/prev button to set the new 'start of view' instead of the date, and redraw the view base upon that new start date?




Feb 21, 2015
Project Member #1 adamrs...@gmail.com
I haven't come up with the best general API for doing this yet, but agree with you, it should be easier to the end developer.
Summary: Custom views, easily customize prev/next duration jump (was: custom next/prev movement in view)
Status: Accepted
Labels: Type-Feature
Feb 22, 2015
#2 war...@gmail.com
could you point me at the right section of code that sets the views start date for rendering? 
Feb 22, 2015
Project Member #3 adamrs...@gmail.com
Sounds like you were going down the right page. It seems like you might need to force rendering to happen. around here:

https://github.com/arshaw/fullcalendar/blob/master/src/Calendar.js#L541

add a 'force' param or simply always make that if statement true. 
Feb 22, 2015
Project Member #4 adamrs...@gmail.com
*path
Feb 26, 2015
#5 war...@gmail.com
Thanks... now i'm having trouble overriding the next and prev calls inside my view:

var TwoWeeks = fcViews.twoweeks = BasicView.extend({
next: function() {

}
});

doesn't work... I don't have tons of experince with javascript.

Aug 21, 2015
Project Member #6 adamrs...@gmail.com
Discussion for this issue has moved to the following URL:
https://github.com/fullcalendar/fullcalendar/issues/2710

This is because Google Code is shutting down. Apologies if you are being pestered with these notifications. This is a one-time event.

Happy coding,
Adam
Status: ExportedToGithub
Sign in to add a comment

Powered by Google Project Hosting