time displayed and time in mysql

Hi, i would like to ask if there’s anyway i can display part of events for the next day on today’s date? For example, i have an event on 22 March 2010 6pm, and another event on 23 March 2010 2am. I would like to have it displayed under the date 22 March 2010 in dhtmlScheduler. I’ve tried these codes:

scheduler.config.first_hour = 4;
scheduler.config.last_hour = 28;

The hour_date displayed correctly like this:


But unfortunately the event on 23 March 2010 2am is not displayed. I’ve an idea, to display the hour_date from 4am 22 March 2010 till 3am 23 March (like the 1 the attached picture) but the time of the event saved into mysql is actually backdated 4 hours. This way, if i were to create an event in 2am of 23 March 2010, it will actually saved as 10pm of 22 March 2010. Is there anyway to add a 4 hour stepping to the hour_date displayed on the left but not the actual data?

But unfortunately the event on 23 March 2010 2am is not displayed.
There are inner checks that prevent data output in the incorrect column. It can be changed only by code modification.

Is there anyway to add a 4 hour stepping to the hour_date displayed on the left but not the actual data?

While it may be a confusing scenario ( store incorrect dates in DB ), it can be implemented on client side by using

scheduler.config.first_hour = 0;
scheduler.config.last_hour = 24;
var original = scheduler.templates.hour_scale();
scheduler.templates.hour_scale = function(date){
return original(scheduler.data.add(date, -4, “hour”))
};

With such code scheduler will work in normal 0-24 mode, but labels on the scale will be shifted.

The scheduler went blank with the codes. I’m still trying to get the code running. Could you please check if there’s any line left? Scheduler shows the grid without any data if i commented this line:

var original = scheduler.templates.hour_scale();

Thank you.

It was a bit more complex , please check the attached sample.
1269268421.zip (45.9 KB)

Thank you very much. I found an alternative solution also, under dhtmlscheduler.js, replace

var C=new Date(1980,1,1,this.config.first_hour,0,0)

with

var C=new Date(1980,1,1,this.config.first_hour+4,0,0)

Your code is alot more tidy. Thank you.