#!/usr/bin/perl -w # -*- Mode: perl -*- #====================================================================== # # This package is free software and is provided "as is" without # express or implied warranty. It may be used, redistributed and/or # modified under the same terms as perl itself. ( Either the Artistic # License or the GPL. ) # # $Id: Period.pm,v 1.19 2001/08/04 04:59:36 srl Exp $ # # (C) COPYRIGHT 2000-2001, Reefknot developers. # # See the AUTHORS file included in the distribution for a full list. #====================================================================== =head1 NAME Net::ICal::Period -- represent a period of time =cut package Net::ICal::Period; use strict; use UNIVERSAL; use base qw(Net::ICal::Property); use Data::Dumper; use Net::ICal::Duration; use Net::ICal::Time; =head1 SYNOPSIS 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")); =head1 DESCRIPTION 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. =head1 BASIC METHODS =head2 new($time, $time|$duration) Creates a new period object given to parameters: The first must be a I