search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Limit displayed weeks in Month calendar...

Asked by Dee
6 years ago.

I need to display three weeks (last, this, next) centered around a week chosen by the Navigator.

ISSUES:
1) Month always starts first row with month's first day regardless of what StartDate is set to.
2) No way without modifying the month.js file to limit weeks displayed.
3) The month will all six weeks is to large for my use. I would like to use the month calendar to create/display/move/etc events. The server would use the event to trigger population of the event data in a form in a different tile view. A six week display crowds out the form.

I would like to select a date in the navigator with week selection:
var dpn = new DayPilot.Navigator("dpn");
dpn.bound = "dpm";
dpn.selectMode = 'week';
dpn.cssClassPrefix = "navigator_silver_";
dpn.weekStarts = 0;
dpn.showMonths = 2;
dpn.skipMonths = 2;
dpn.Init();

I would like the month to display only three weeks (without a hack):
month.js:
var $06 = this.startDate;
var $07;
if (this.viewType === 'Month')
{
var $08 = this.lastVisibleDayOfMonth().d;
var $09 = DayPilot.Date.daysDiff(this.firstDate, $08) + 1;
$07 = Math.ceil($09 / 7);
}
else
{
$07 = this.weeks;
};

// DEE - hard code weeks to 3
$07 = 3;

this.days = $07 * 7;
this.rows = [];
for (var x = 0; x < $07; x++)

Those three weeks (amount to be customizable) will be centered on the week chosen by the Navigator.

Answer posted by Dan Letecky [DayPilot]
6 years ago.

This is possible if you set viewType to "Weeks" and weeks to 3:

dpm.viewType = "Weeks";
dpm.weeks = 3;

This question is more than 6 months old and has been closed. Please create a new question if you have anything to add.