Hi,
I have a doubt in calendar, how to change my start weekday, so the first day in the 'week view' mode is Monday ?
Thanx
Hi,
I have a doubt in calendar, how to change my start weekday, so the first day in the 'week view' mode is Monday ?
Thanx
see:
/** Modifies the "firstDayOfWeek" parameter (pass 0 for Synday, 1 for Monday, etc.). */
Calendar.prototype.setFirstDayOfWeek = function (firstDayOfWeek) {
this._init(firstDayOfWeek, this.date);
this._displayWeekdays();
};
in /jscalendar/calendar.js
Wadii
Can you give more detalied instructions, please? This confuses me somehow, since there is a definition in the beginning of the file, which might also be reviewd.
Thanks
Juergen
This space is for rent ;-)
I'm sorry for the bad answer, the param that you must modify is:
/jscalendar/ calendar-setup_3.js
line 80
param_default("firstDay", 1); // defaults to "Sunday" first 0 to "Monday" first
Wadii
Hi Wadii,
not a problem, but unfortunately, this did not work :-(
Any other idea?
Thanks
Juergen
This space is for rent ;-)
No, there's nothing to do with JavaScript........
I meant in Calendar module, you know you have 4 view modes, Day, Week, Month and Year.
In Week mode, the week starts on Sunday and ends on Saturday, how to change it so the week is from Monday to Sunday ?
Last edited by eturi; 2005-06-13 at 09:57 PM.
Hame problem here. I am trying to find out a solution. Will write here if i find one.
OK. I think I found, anyhow it works okay.
Three things:
The main - templates_calendar.php line 645 (3.5.0.b release)
for($i=0;$i<7;$i++) change to for($i=1;$i<8;$i++)
also line 683 better to change if($j==0 || $j==6) to if($j==5 || $j==6) for coloring the non-work weekdays
**************************
WEEK VIEW and SHARED:
Calendar.php line 178 maybe somewhere
for($i=0;$i<$days_in_week;$i++) change to for($i=1;$i<8;$i++)
datetime.php line 508 make as here (before was day_index > 6)
if ( $day_index < 0 || $day_index > 7 )
{
sugar_die("day is outside of week range");
}
**************************************
also in calendar-setup_3.js
make param_default("firstDay", 1); // defaults to "Sunday" first
And better to delete in Calendar.php this
if( substr_count($time, 'H') > 0)
{
$this->use_24 = 0;
}
Last edited by alicetee; 2005-08-31 at 03:01 PM.
But trying to move the days.. they are moved..
Solution is not ready to work!!
Last edited by alicetee; 2005-08-31 at 05:07 PM.
New solution!
Calendar.php line 165 make $first_day_of_month = $this->date_time->get_day_by_index_this_month(6);
from $first_day_of_month = $this->date_time->get_day_by_index_this_month(0);
also line 683 better to change if($j==0 || $j==6) to if($j==5 || $j==6) for coloring the non-work weekdays
WEEK VIEW and SHARED:
Calendar.php line 178 maybe somewhere
for($i=0;$i<$days_in_week;$i++) change to for($i=1;$i<8;$i++)
datetime.php line 508 make as here (before was day_index > 6)
if ( $day_index < 0 || $day_index > 7 )
{
sugar_die("day is outside of week range");
}
templates_calendar.php line 810 make $first_day = $date_time->get_day_by_index_this_week(1);
Last edited by alicetee; 2005-08-31 at 06:07 PM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks