Net::ICal::Period - represent a period of time


Net-ICal documentation  | view source Contained in the Net-ICal distribution.

Index


NAME

Top

Net::ICal::Period -- represent a period of time

SYNOPSIS

Top

  use Net::ICal;
  $p = new Net::ICal::Period("19970101T120000","19970101T123000");
  $p = new Net::ICal::Period("19970101T120000","PT3W2D40S");
  $p = new Net::ICal::Period(time(),3600);
  $p =   new Net::ICal::Period(
		      new Net::ICal::Time("19970101T120000",
					  "America/Los_Angeles"),
		      new Net::ICal::Duration("2h"));

DESCRIPTION

Top

Use this to make an object representing a block of time on a real schedule. You can either say, "This event starts at 12 and ends at 2" or "This event starts at 12 and lasts 2 hours."

These two ways of specifying events can be treated differently in schedules. If you say, "The meeting is from 12 to 2, but I have to leave at 2," you are implying that the start date and end date are fixed. If you say, "I have a 2-hour drive to Chicago, and I need to leave at 4," you are saying that it will take 2 hours no matter when you leave, and that moving the start time will slide the end time correspondingly.

BASIC METHODS

Top

new($time, $time|$duration)

Creates a new period object given to parameters: The first must be a Time object or valid argument to Net::ICal::Time::new.

The second can be either:

* a Time object
* a valid argument to Net::ICal::Time::new.
* a Duration object
* a valid argument to Net::ICal::Duration::new.

Either give a start time and an end time, or a start time and a duration.

new($time, $time|$duration)

Creates a new period object given to parameters: The first must be a Time object or valid argument to Net::ICal::Time::new.

The second can be either:

* a Time object
* a valid argument to Net::ICal::Time::new.
* a Duration object
* a valid argument to Net::ICal::Duration::new.

Either give a start time and an end time, or a start time and a duration.

is_valid()

Return true if: There is an end time and: Both start and end times have no timezone ( Floating time) or Both start and end time have (possibly different) timezones or Both start and end times are in UTC and The end time is after the start time.

  There is a duration and the duration is positive  

as_ical_value

Another name for as_ical.

compare([$time])

Takes a Net::ICal::Time as a parameter. If the parameter is a Time, returns 0 if time is in the period, -1 if the time is before the period and 1 if the time is after the period.

union([$period])

Takes another Period as a parameter. Returns 0 if the given period overlaps this period, -1 if the given Period is before this one, and 1 if the given Period is after this one.

SEE ALSO

Top

More documentation pointers can be found in Net::ICal.


Net-ICal documentation  | view source Contained in the Net-ICal distribution.