Start Day

Help with installation and general calendar setttings

Start Day

Postby Santi » Fri Apr 29, 2011 11:54 pm

Really like the calendar but I wondered whether it was relatively easy to be able to change the start day to a Saturday?

Thanks
Santi
 
Posts: 2
Joined: Fri Apr 29, 2011 11:47 pm

Re: Start Day

Postby chris » Sat Apr 30, 2011 10:05 am

Hi,
Could you take a look at this thread and follow it through (adapting it for Saturday of course).

Note. There is an extra fix required towards the end of the thread.

let me know how it goes and if you run into any problems.

Chris
User avatar
chris
Site Admin
 
Posts: 1089
Joined: Mon Dec 17, 2007 7:42 pm
Location: Málaga, Spain

Re: Start Day

Postby Santi » Sat Apr 30, 2011 6:00 pm

Chris,
Thanks for the thread link. The code has changed a little from the previous version but I think I have managed to tweak it.
Changes were : in the includes, functions.inc.php file, I replaced this
Code: Select all
   if(AC_START_DAY=="sun"){
      //$cal_row_counter=0;
      for($k=0; $k<7; $k++){
         $weekday = substr($lang["day_".$k.""],0,1);
         $list_day_titles.='<li class="cal_weekday"> '.$weekday.'</li>';
      }
   }else{
      //$cal_row_counter=1;
      if ($first_week_day == 0)   $first_week_day =7;
      for($k=1; $k<=7; $k++){
         //echo "<br>".$k;
         if($k==7)    $weekday = substr($lang["day_0"][0],0,1);
         else      $weekday = substr($lang["day_".$k.""],0,1);
         $list_day_titles.='<li title="'.$lang["day_".$k.""].'"> '.$weekday.'</li>';
      }
   }

with this (which was a combination of the old thread and the existing code)
Code: Select all
$d=6;   # saturday is number 6
for($k=1; $k<=7; $k++){
         $weekday = substr($lang["day_".$d.""],0,1);
         $list_day_titles.='<li title="'.$lang["day_".$d.""].'"> '.$weekday.'</li>';
   ++$d;
   $d %= 7; # reset to 0
}

Then I replaced this code :
Code: Select all
if(AC_START_DAY=="sun")   $first_week_day_start   =   $first_week_day;   # start sunday
   else                  $first_week_day         =   $first_week_day-1;   # start monday


With this:
Code: Select all
$first_week_day         =   $first_week_day+1;

It looks OK but would be grateful if you would confirm the changes made will not have an impact on something else I am not aware of.
Thanks again.
Santi
 
Posts: 2
Joined: Fri Apr 29, 2011 11:47 pm

Re: Start Day

Postby chris » Sat Apr 30, 2011 7:17 pm

That's good news that you have been able to adapt the code in the other thread to fit this version.

To be honest, if it all looks OK I'm sure that it is. There isn't really much that can go wrong ;)
To be sure check through a few years ahead to see if all the months are OK.

Chris
User avatar
chris
Site Admin
 
Posts: 1089
Joined: Mon Dec 17, 2007 7:42 pm
Location: Málaga, Spain


Return to Support

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

cron