Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes
calIDateTime Interface Reference

import "calIDateTime.idl";

Inheritance diagram for calIDateTime:
Inheritance graph
[legend]
Collaboration diagram for calIDateTime:
Collaboration graph
[legend]

List of all members.

Public Member Functions

void makeImmutable ()
 Make this calIDateTime instance immutable.
calIDateTime clone ()
 Clone this calIDateTime instance into a new mutable object.
void resetTo (in short year, in short month, in short day, in short hour, in short minute, in short second, in calITimezone timezone)
 Resets the datetime object.
void reset ()
 Resets this instance to Jan 1, 1970 00:00:00 UTC.
AUTF8String toString ()
 Return a string representation of this instance.
void setTimeInTimezone (in PRTime aTime, in calITimezone aTimezone)
 Set the value of this calIDateTime instance to aTime milliseconds since the epoch in the given timezone.
calIDateTime getInTimezone (in calITimezone aTimezone)
 Return a new calIDateTime instance that's the result of converting this one into the given timezone.
void addDuration (in calIDuration aDuration)
calIDuration subtractDate (in calIDateTime aOtherDate)
long compare (in calIDateTime aOther)
 Compare this calIDateTime instance to aOther.
void toIcalTime (in icaltimetypeptr itt)

Public Attributes

readonly attribute boolean isMutable
 isMutable is true if this instance is modifiable.
readonly attribute boolean isValid
 valid is true if this object contains a valid time/date.
attribute PRTime nativeTime
 nativeTime contains this instance's PRTime value relative to the UTC epoch, regardless of the timezone that's set on this instance.
attribute short year
 Full 4-digit year value (e.g.
attribute short month
 Month, 0-11, 0 = January.
attribute short day
 Day of month, 1-[28,29,30,31].
attribute short hour
 Hour, 0-23.
attribute short minute
 Minute, 0-59.
attribute short second
 Second, 0-59.
attribute calITimezone timezone
 Gets or sets the timezone of this calIDateTime instance.
readonly attribute long timezoneOffset
 The offset of the timezone this datetime is in, relative to UTC, in seconds.
attribute PRBool isDate
 isDate indicates that this calIDateTime instance represents a date (a whole day), and not a specific time on that day.
readonly attribute short weekday
 Day of the week.
readonly attribute short yearday
 Day of the year, 1-[365,366].
readonly attribute calIDateTime startOfWeek
 Returns SUNDAY of the given datetime object's week.
readonly attribute calIDateTime endOfWeek
 Returns SATURDAY of the datetime object's week.
readonly attribute calIDateTime startOfMonth
readonly attribute calIDateTime endOfMonth
readonly attribute calIDateTime startOfYear
readonly attribute calIDateTime endOfYear
attribute ACString icalString
 This object as either an iCalendar DATE or DATETIME string, as appropriate and sets the timezone to either UTC or floating.

Detailed Description

Definition at line 46 of file calIDateTime.idl.


Member Function Documentation

Clone this calIDateTime instance into a new mutable object.

Compare this calIDateTime instance to aOther.

Returns -1, 0, 1 to indicate if this < aOther, this == aOther, or this > aOther, respectively.

This comparison is timezone-aware; the given values are converted to a common timezone before comparing. If either this or aOther is floating, both objects are treated as floating for the comparison.

If either this or aOther has isDate set, then only the date portion is compared.

Exceptions:
calIErrors.INVALID_TIMEZONEbad timezone on this object (not the argument object)

Return a new calIDateTime instance that's the result of converting this one into the given timezone.

Valid values for aTimezone are the same as the timezone field. If the "floating" timezone is given, then this object is just cloned, and the timezone is set to floating.

Make this calIDateTime instance immutable.

Resets this instance to Jan 1, 1970 00:00:00 UTC.

void calIDateTime::resetTo ( in short  year,
in short  month,
in short  day,
in short  hour,
in short  minute,
in short  second,
in calITimezone  timezone 
)

Resets the datetime object.

Parameters:
yearfull 4-digit year value (e.g. "1989", "2004")
monthmonth, 0-11, 0 = January
dayday of month, 1-[28,29,31]
hourhour, 0-23
minuteminute, 0-59
seconddecond, 0-59
timezonetimezone

The passed datetime will be normalized, e.g. a minute value of 60 will increase the hour.

Exceptions:
NS_ERROR_INVALID_ARGif no timezone is passed in.

Set the value of this calIDateTime instance to aTime milliseconds since the epoch in the given timezone.

AUTF8String calIDateTime::toString ( )

Return a string representation of this instance.


Member Data Documentation

Day of month, 1-[28,29,30,31].

Definition at line 103 of file calIDateTime.idl.

Definition at line 254 of file calIDateTime.idl.

Returns SATURDAY of the datetime object's week.

Definition at line 250 of file calIDateTime.idl.

Definition at line 258 of file calIDateTime.idl.

Hour, 0-23.

Definition at line 108 of file calIDateTime.idl.

This object as either an iCalendar DATE or DATETIME string, as appropriate and sets the timezone to either UTC or floating.

Definition at line 266 of file calIDateTime.idl.

isDate indicates that this calIDateTime instance represents a date (a whole day), and not a specific time on that day.

If isDate is set, accessing the hour/minute/second fields will return 0, and and setting them is an illegal operation.

Definition at line 165 of file calIDateTime.idl.

isMutable is true if this instance is modifiable.

If isMutable is false, any attempts to modify the object will throw NS_ERROR_OBJECT_IS_IMMUTABLE.

Definition at line 53 of file calIDateTime.idl.

valid is true if this object contains a valid time/date.

Definition at line 71 of file calIDateTime.idl.

Minute, 0-59.

Definition at line 113 of file calIDateTime.idl.

Month, 0-11, 0 = January.

Definition at line 98 of file calIDateTime.idl.

nativeTime contains this instance's PRTime value relative to the UTC epoch, regardless of the timezone that's set on this instance.

If nativeTime is set, the given UTC PRTime value is exploded into year/month/etc, taking into account the timezone setting.

Warning:
: When the timezone is set to 'floating', this will return the nativeTime as-if the timezone was UTC. Take this into account when comparing values.
Note:
on objects that are pinned to a timezone and have isDate set, nativeTime will be 00:00:00 in the timezone of that date, not 00:00:00 in UTC.

Definition at line 88 of file calIDateTime.idl.

Second, 0-59.

Definition at line 118 of file calIDateTime.idl.

Definition at line 253 of file calIDateTime.idl.

Returns SUNDAY of the given datetime object's week.

Definition at line 245 of file calIDateTime.idl.

Definition at line 257 of file calIDateTime.idl.

Gets or sets the timezone of this calIDateTime instance.

Setting the timezone does not change the actual date/time components; to convert between timezones, use getInTimezone().

Exceptions:
NS_ERROR_INVALID_ARGif null is passed in.

Definition at line 127 of file calIDateTime.idl.

The offset of the timezone this datetime is in, relative to UTC, in seconds.

A positive number means that the timezone is ahead of UTC.

Definition at line 157 of file calIDateTime.idl.

Day of the week.

0-6, with Sunday = 0.

Definition at line 174 of file calIDateTime.idl.

Full 4-digit year value (e.g.

"1989", "2004")

Definition at line 93 of file calIDateTime.idl.

Day of the year, 1-[365,366].

Definition at line 179 of file calIDateTime.idl.


The documentation for this interface was generated from the following file: