Read-only in the past

Hi,

in my project, the scheduler have to be in read-only mode for the past.
I’ve tried to use scheduler.blockTime like this :

scheduler.blockTime({ start_date: new Date(2000,1,1), end_date: new Date(2012,12,18), zones: 'fullday' });
my end_date is generated by php.
In this case, my scheduler is read-only till 17 january 2013 (included) :open_mouth:

So i decide to try with this instead :

scheduler.config.limit_end = new Date (2000,1,1); scheduler.config.limit_end = new Date (2012,12,18);
In this case, it doesn’t do anything…

Any idea ?

After many try, i’ve found how to have good date :

to block from 1st january 2000 to 18 january 2012, i need to have :

scheduler.blockTime({ start_date: new Date(2000,0,1), end_date: new Date(2012,11,19), zones: 'fullday' });
so strange…

Hello,

Be sure to check following sample:
dhtmlxScheduler/samples/03_extensions/16_limitation.html

Best regards,
Ilya

This sample does not use scheduler.blockTime

And shows how to set up date range when you can create events.

Kind regards,
Ilya

It is interesting how fragile the blockTime functionality seems to be. If you do not get something exactly correct, it just does nothing. Makes it a bit hard to see what is wrong with what you have done.

Sort of like that old joke, How many prolog programmers does it take to screw in a lightbulb? false.

It is also surprising how many places the DMHX documentation says things like “For an end date of Dec 12 use ‘end_date: new Date(2012,12,18)’” and, as one finds out, the month is counted started at 0, so December is 11, not 12.

As for second part - please PM the link to the misleading pages in documentation (we will check from our side as well )

Hi,

i’m back again…
i tried to use this code in my scheduler :

scheduler.blockTime({ start_date: new Date(2000,0,1), end_date: new Date(2013,01,14), zones: 'fullday' });

For week view, it work perfectly (thanks :wink: )
But in timeline view, it break my scheduler.

I’ve seen there was an issue with it in the past so my question is : this poblem was resolved or not ?
is this function usable with timeline view ?
If yes, how can i use it ?

i have re-downloaded dhtmlx scheduler and my scheduler is now displayed.
but i have still a problem with the timeline view.
when i use the blockTime method, it doesn’t block the good periods.
For example, when i put this :

scheduler.blockTime({ start_date: new Date(2000,0,1), end_date: new Date(2013,01,14), zones: 'fullday' });
My scheduler is blocked till feb 17, 2013 (included) :open_mouth:

when i put this :

scheduler.blockTime({days: 0,zones: 'fullday'});

or

scheduler.blockTime({days: 6,zones: 'fullday'});

my scheduler is blocked every days.

These parameters work fine with week view.

Any idea ?

Hello,
I couldn’t reproduce your problem. Following code is blocking scheduler till 14 February 2013, as expected.scheduler.blockTime({ start_date: new Date(2000,0,1), end_date: new Date(2013,01,14) });
Please check this sample, can you reproduce issue there?
dhtmlxScheduler/samples/03_extensions/25_advanced_limitation.html

Here is a demo of what’s happen.
I know there is not the files to load datas but the problem is here
demo.zip (1.17 MB)

I’ve found.
I have inverted the js file to be included for timeline and limit

But i have an other problem that i can’t resolve and i think it’s an issue.

When i use :

scheduler.blockTime({days: 6,zones: 'fullday'});

Saturday is perfectly blocked and i can see this day in gray.

But when i use :

scheduler.blockTime({days: 0,zones: 'fullday'});

Sunday is blocked (i can’t add events) but this day is not in gray.

When i analyse the html code generated, i found that :

<div class="dhx_time_block dhx_marked_timespan " style="height: 125px; left: 628px; width: 1px; top: 0px;"></div>

The width property value is 1 px.
When i use it for other days, the value is 104 px.

How can i resolve it ?