| Issue 2445: | Custom views, easily customize prev/next duration jump | |
| 1 person starred this issue and may be notified of changes. | Back to list |
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 22, 2015
could you point me at the right section of code that sets the views start date for rendering?
Feb 22, 2015
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
*path
Feb 26, 2015
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
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 |
Status: Accepted
Labels: Type-Feature