class SAPO.Utility.TimeSlot
Authors:
jose.p.dias AT co.sapo.pt
Version:
0.1
Since:
February 2011
Defined in Utility/TimeSlot/0.1/lib.js

Constructor Summary
TimeSlot (String|TimeEvent|undefined startEvt, [String|TimeEvent|undefined durationEvt], [String|TimeEvent|undefined endEvt], [Object custom])

Function Summary
returns new TimeSlot
TimeSlot fromIcal (Object icalEvt)
Returns a Timeslot from a given ical object (which must have at least DTSTART and DTEND SUMMARY is stored as title and LOCATION is stored as custom.
moveStartTo (TimeEvent newStart)
moves slot given a new start position
setCustom (Object cstm)
sets custom
setDuration (TimeEvent duration)
sets duration
setTitle (String title)
sets title
setType (String type)
sets type
shiftBy (TimeEvent deltaT)
moves slot given a delta time
Number sortFn (TimeEvent a, TimeEvent b)
user to sort lists of TimeSlots chronologically (based on start)
Number sortFn2 (TimeEvent a, TimeEvent b)
user to sort lists of TimeSlots chronologically (based on midpoint)

Constructor Details

constructor TimeSlot

TimeSlot(String|TimeEvent|undefined startEvt, [String|TimeEvent|undefined durationEvt], [String|TimeEvent|undefined endEvt], [Object custom])
Parameters:
startEvt - start
[durationEvt] - duration
[endEvt] - end
[custom] - optional custom object for holding additional data

Function Details

function clone

TimeSlot clone()
returns new TimeSlot

function fromIcal

TimeSlot fromIcal(Object icalEvt)
Returns a Timeslot from a given ical object (which must have at least DTSTART and DTEND SUMMARY is stored as title and LOCATION is stored as custom.
Parameters:
icalEvt

function moveStartTo

moveStartTo(TimeEvent newStart)
moves slot given a new start position
Parameters:
newStart

function setCustom

setCustom(Object cstm)
sets custom
Parameters:
cstm

function setDuration

setDuration(TimeEvent duration)
sets duration
Parameters:
duration

function setTitle

setTitle(String title)
sets title
Parameters:
title

function setType

setType(String type)
sets type
Parameters:
type

function shiftBy

shiftBy(TimeEvent deltaT)
moves slot given a delta time
Parameters:
deltaT

function sortFn

Number sortFn(TimeEvent a, TimeEvent b)
user to sort lists of TimeSlots chronologically (based on start)
Parameters:
a
b

function sortFn2

Number sortFn2(TimeEvent a, TimeEvent b)
user to sort lists of TimeSlots chronologically (based on midpoint)
Parameters:
a
b

function toString

String toString()
Returns:
string representation