Constructor
new Period(aData)
Creates a new ICAL.Period instance. The passed data object cannot contain both and end date and a duration.
Name | Type | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
aData | Object | An object with members of the period Properties
|
Members
duration :ICAL.Duration
The duration of the period
end :ICAL.Time
The end of the period
(constant) icalclass :String
The class identifier.
- String
- Default Value
- "icalperiod"
(constant) icaltype :String
The type name, to be used in the jCal object.
- String
- Default Value
- "period"
start :ICAL.Time
The start of the period
Methods
clone() → {ICAL.Period}
Returns a clone of the duration object.
The cloned object
- Type:
- ICAL.
Period
getDuration() → {ICAL.Duration}
Calculates the duration of the period, either directly or by subtracting start from end date.
The calculated duration
- Type:
- ICAL.
Duration
getEnd() → {ICAL.Time}
Calculates the end date of the period, either directly or by adding duration to start date.
The calculated end date
- Type:
- ICAL.
Time
toICALString() → {String}
The iCalendar string representation of this period.
- Type:
- String
toJSON() → {Object}
The jCal representation of this period type.
- Type:
- Object
toString() → {String}
The string representation of this period.
- Type:
- String
(static) fromData(aData) → {ICAL.Period}
Creates a new ICAL.Period instance from the given data object. The passed data object cannot contain both and end date and a duration.
Name | Type | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
aData | Object | An object with members of the period Properties
|
The period instance
- Type:
- ICAL.
Period
(static) fromJSON(aData, aProp, aLenient) → {ICAL.Period}
Returns a new period instance from the given jCal data array. The first member is always the start date string, the second member is either a duration or end date string.
Name | Type | Description |
---|---|---|
aData | jCalComponent | The jCal data array |
aProp | ICAL. | The property this jCal data is on |
aLenient | Boolean | If true, data value can be both date and date-time |
The period instance
- Type:
- ICAL.
Period
(static) fromString(str, prop) → {ICAL.Period}
Creates a new ICAL.Period instance from the passed string.
Name | Type | Description |
---|---|---|
str | String | The string to parse |
prop | ICAL. | The property this period will be on |
The created period instance
- Type:
- ICAL.
Period