[Vtigercrm-developers] vtiger popup calendar start day of the week

Joe Bordes joe at tsolucio.com
Wed Nov 8 15:50:30 PST 2006


Hi,

I tried to get the VT calendar start on monday instead of sunday. I
found the code very hard to follow and, to my surprise, there was no
variable whose value I could change to get the calendar start on monday.
As I did for the javascript calendar changing the variable firstDay.

I finaly add a bit of code to the modules/Calendar/Calendar.php

I changed line 111
   $num_of_prev_days = $firstday_of_month->dayofweek;

to
   $num_of_prev_days = ($firstday_of_month->dayofweek==0 ? 6 :
$firstday_of_month->dayofweek-1);

And the same for year. I changed line 127
  $noof_prevdays = $firstday_of_month->dayofweek;

to
  $noof_prevdays = ($firstday_of_month->dayofweek==0 ? 6 :
$firstday_of_month->dayofweek-1);

This seems to be working fine but I really don't know what I am doing.
 Does this break other things?
 Will I start getting activities and notifications on the wrong dates?
 Is there really no global variable I can change to get the calendar
start on monday?

Any comments would be greatly appreciated.

Thanks, Joe
TSolucio





More information about the vtigercrm-developers mailing list