Page 1 of 1

Help removing weekend from calendar script

Posted: Tue Feb 23, 2010 2:44 pm
by Rippie
I could really do with some help in removing Saturday and Sundays from a weekend script. Basically a friend gave me some code that would output monday to sunday, but i dont need saturday and sunday, but i cant find a way either not to show them.

The script basically show me 2 weeks ahead from the day im on. so right now it would show me from Tuesday to Tuesday in 2 weeks.

code i have:

Code: Select all

#create table headers
function createTableHeaders($value, $value1, $value2) {
  echo "<tr>";
  $dV = $value2;
  for ($i = $value; $i < $value1; $i++) {
    echo "<th>".date('D dS M', time()+$dV)."</th>";
    $dV = $dV + 86400;
  }
  echo "</tr>";
}
Above code print out monday tuesday wednesday thursday friday saturday sunday.

Can anyone help me to to get rid of saturday and sunday ??

Rippie

Re: Help removing weekend from calendar script

Posted: Tue Feb 23, 2010 3:01 pm
by AbraCadaver
Depends upon how you call the function. What are $value, $value1, $value2?

Re: Help removing weekend from calendar script

Posted: Tue Feb 23, 2010 3:05 pm
by Rippie
Honestly i am not completely sure. :( but i can try read the code and figure out. But what i want to achieve is a script that shows something like this:

Current week:
Monday - Tuesday - Wednesday - Thursday - Friday

Next week:
Monday - Tuesday - Wednesday - Thursday - Friday

the script is going to be used in a "show availability for next 2 weeks" script, and of course it has to be dynamic so i dont have to update the weeks myself.

Rippie