HTML_calendar more info req.

It’s a grate facility!

I need same extra info about.

Is it possible to get marked only same days ( I chose ) to make for me one user friendly diagram?
I have to get one calendar for every rooms to get in relation the calendar with the free room for my work.

this is the job of “freecolours”

var date = new Date();
{
//If no parameter is passed use the current date.
if(date == null)
date = new Date();

day = date.getDate();
month = date.getMonth();
year = date.getFullYear();
months = new Array(‘gennaio’,
‘febbraio’,
‘marzo’,
‘aprile’,
‘maggio’,
‘giugno’,
‘luglio’,
‘agosto’,
‘settembre’,
‘ottobre’,
‘novembre’,
‘dicembre’);

this_month = new Date(year, month, 1);
next_month = new Date(year, month + 1, 1);

//Find out when this month starts and ends.
first_week_day = this_month.getDay();
days_in_this_month = Math.floor((next_month.getTime() - this_month.getTime()) / (1000 * 60 * 60 * 24));

calendar_html = ‘’ +
‘’ +
‘’ +

’ +
‘’ +
’ +
‘’;

calendar_html += ‘

’;

calendar_html += ‘

’;

//Fill the first week of the month with the appropriate number of blanks.
for(week_day = 1; week_day < first_week_day; week_day++)
{
calendar_html += ‘

’;
}

week_day = first_week_day;
for(day_counter = 1; day_counter <= days_in_this_month; day_counter++)
{
week_day %= 7;

if(week_day == 1)
calendar_html += ‘

’;

//Do something different for the current day.
if(day == day_counter)
calendar_html += ‘

’;
else
calendar_html += ‘’;

week_day++;
}

calendar_html += ‘

’;
calendar_html += ‘
’ +
’ +
months[month] + ’ ’ + year + ‘
’ +
’ + day_counter + ‘ ’ +
day_counter + ’
’;

//Display the calendar.
globals.gCalender = calendar_html;
}

thank you

any one can help me ?

fabio2:
It’s a grate facility!

Thanks!

I need same extra info about.
Is it possible to get marked only same days ( I chose ) to make for me one user friendly diagram?
I have to get one calendar for every rooms to get in relation the calendar with the free room for my work.

Can you explain a bit more in detail what you really want and where you want to get data from?

Thank you for the Replies,

I need a calendar for every one room with the occupied day marked.

So I can instantly see on the calendar , marked with different colors the occupied days, for every room .

Example:
Room N1 occupied from 10 to 14 July
room N 4 occupied from 5 to 18 July

(Table rooms with: the fields “from_date” and “To_date” and field “Room_number”)

fabio2:
Thank you for the Replies,

I need a calendar for every one room with the occupied day marked.

So I can instantly see on the calendar , marked with different colors the occupied days, for every room .

Example:
Room N1 occupied from 10 to 14 July
room N 4 occupied from 5 to 18 July

(Table rooms with: the fields “from_date” and “To_date” and field “Room_number”)

I’m afraid what you’re looking will require some work: you don’t need a calendar, actually, but a reservation system.
So you have to build a set of queries that will assign a colour to a day if a room is busy in that particular date.

You can find some sample code, to use with the code of the beautiful calendar of Freecolors, on Servoy magazine (look for “html agenda”).

But, again, it will require a lot of work… :-)

fabio2:
I need a calendar for every one room with the occupied day marked.

Does this mean that you want a separate calendar for every room?
In this case you need to get an array with days that the defined room is occupied and -while you set the table row for each day- compare this with the days that you set in the calendar. Done! :wink:

In case you want to see multiple rooms on one calendar, it is possible, but things get a bit more complex, because the calendar containes only one table row for each day (). If you want to have more rooms listed in one day, you need to set multiple table rows in one day. I assume that you reserve the row amount from the number of rooms you total have each day. But as I said, it is possible, but a bit more complex.

thank you Freecolours and Riccardino

Does this mean that you want a separate calendar for every room?
In this case you need to get an array with days that the defined room is occupied and -while you set the table row for each day- compare this with the days that you set in the calendar. Done!

this is right

Can same one explain me the exact way to do this… :oops:

fabio2:
Can same one explain me the exact way to do this… :oops:

Not so easy.
First of all, you’ve to decide where you want to display this information.

In a record view? Build a procedure according to Karel’s suggestions and put an OnRecordSelect method that will fire a new query every time you move to a different room.

But if you need a list of rooms and you’ve got to display all the different calendars for each row, the matter is much more complicated.

Ciao Ric,

Not so easy.

If for you It’s not so easy.
for me it’s verry difficoult.

Thank you for your replay

Any other suggestions are welcome.

cheers Fabio