Logo Search packages:      
Sourcecode: davical version File versions  Download package

iCalDate::GetWeekByDay ( byday,
increasing = false 
)

Applies any BYDAY to the week to return a set of days

Parameters:
string$bydayThe BYDAY rule
string$increasingWhen we are moving by months, we want any day of the week, but when by day we only want to increase. Default false.
Returns:
array An array of the day numbers for the week which meet the rule.

Definition at line 445 of file RRule.php.

                                                     {
    global $ical_weekdays;
    dbg_error_log( "RRule", " Applying BYDAY %s to week", $byday );
    $days = split(',',$byday);
    $dow = date('w',$this->_epoch);
    $set = array();
    foreach( $days AS $k => $v ) {
      $daynum = $ical_weekdays[$v];
      $dd = $this->_dd - $dow + $daynum;
      if ( $daynum < $this->_wkst ) $dd += 7;
      if ( $dd > $this->_dd || !$increasing ) $set[$dd] = $dd;
    }
    asort( $set, SORT_NUMERIC );

    return $set;
  }

Generated by  Doxygen 1.6.0   Back to index