scheduler repositioning startday in weekview

Hi,

is it possible to reposition the startdate in the weekview?
I saw that it’s possible to choose between monday and sunday as the start of a week, but I want the first day to be displayed in the scheduler to be the current day and then have a view over the next 6 days.

For example: today is wednesday 2 march, so I would like to have the scheduler display the weekview as wednesday 2 march, thursday 3 march, friday 4 march, saturday 5 march, sunday 6 march, monday 7 march and tuesday 8 march.

when I open the sheduler tomorrow it should start on thursday.

Is this possible? If so how?

kind regards,
Arno.

Hello,

Try adding

scheduler.date.week_start = scheduler.date.day_start;

before scheduler.init call.

Best regards,
Ilya

This works perfectly!
Thanks for the quick response!

kind regards,
Arno.

Hi,

This answer works for the scheduler, but now I want to include a minical (in the examples: \samples\05_calendar\01_select.html)

It seems when I use this line of code scheduler.date.week_start = scheduler.date.day_start; to reposition the scheduler, it produces an erronous minical. The minical then displays March 1 as a wednesday instead of a tuesday. If I remove the line it displays March 1 as a tuesday.

Is this a bug or am I doing something wrong?

kind regards,
Arno.

Hello, Arno Vanbeginne.

Minicalendar is a scheduler itself with some modifications rendered in a small div. That’s why changes to scheduler’s default views could make minicalendar displayed incorrectly.
There are two options to solve this:

  1. Edit
function show_minical(){

function in \samples\05_calendar\01_select.html (and your project if you are using something similar).
Full edited sample:

[code]

<script src="../../codebase/ext/dhtmlxscheduler_minical.js" type="text/javascript" charset="utf-8"></script>
<link rel="stylesheet" href="../../codebase/ext/dhtmlxscheduler_ext.css" type="text/css" media="screen" title="no title" charset="utf-8">
html, body{ margin:0px; padding:0px; height:100%; overflow:hidden; }
 
 
 
[/code] 2. Create your own custom view with view_start = scheduler.date.day_start. That way you won't need to make any changes to default view week and minicalendar will be displayed correctly. Also you don't need to display default week view: [code]
[/code] I have deleted 'week_tab' so it won't be displayed. You can add your own view instead of it. Check "[url=http://docs.dhtmlx.com/doku.php?id=dhtmlxscheduler:custom_views]Custom views in dhtmlxScheduler[/url]" page in documentation for details.

Best regards,
Ilya

Ilya,

thank you for this extensive answer, it helped me a lot.

kind regards,
Arno.