mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-02 15:15:23 +00:00
Allow calIDateTime objects to expose an ical-serialized version of the object as an attribute. Not part of the build.
This commit is contained in:
parent
1f56b71934
commit
8d681690e9
@ -150,6 +150,12 @@ interface calIDateTime : nsISupports
|
||||
|
||||
[noscript,notxpcom] void toIcalTime(in icaltimetypeptr itt);
|
||||
|
||||
/**
|
||||
* This object as either an iCalendar DATE or DATETIME string, as
|
||||
* appropriate.
|
||||
*/
|
||||
readonly attribute ACString icalString;
|
||||
|
||||
/* JS only:
|
||||
* attribute Date jsDate;
|
||||
*/
|
||||
|
@ -290,6 +290,23 @@ calDateTime::GetEndOfYear(calIDateTime **aResult)
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
calDateTime::GetIcalString(nsACString& aResult)
|
||||
{
|
||||
icaltimetype t;
|
||||
ToIcalTime(&t);
|
||||
|
||||
// note that ics is owned by libical, so we don't need to free
|
||||
char *ics = icaltime_as_ical_string(t);
|
||||
|
||||
if (ics) {
|
||||
aResult.Assign(ics);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
** utility/protected methods
|
||||
|
Loading…
Reference in New Issue
Block a user