You are here

protected function ParserVcalendar::_skip_current_event in Date iCal 7.3

Internal helper function for skipping old events.

1 call to ParserVcalendar::_skip_current_event()
ParserVcalendar::parse in libraries/ParserVcalendar.inc
Parses the vcalendar object into an array of event data arrays.

File

libraries/ParserVcalendar.inc, line 588
Defines a class that parses iCalcreator vcalendar objects into Feeds-compatible data arrays.

Class

ParserVcalendar
@file Defines a class that parses iCalcreator vcalendar objects into Feeds-compatible data arrays.

Code

protected function _skip_current_event() {

  // Must use !isset() here, because 0 and NULL mean different things.
  if (!isset($this->config['skip_days'])) {
    return FALSE;
  }
  $compare_date = isset($this->parsed_data['DTEND']) ? $this->parsed_data['DTEND'] : $this->parsed_data['DTSTART'];
  $skip_date = new FeedsDateTime("today -{$this->config['skip_days']} days", $compare_date
    ->getTimezone());
  $skip = $skip_date > $compare_date;
  return $skip;
}