зеркало из https://github.com/mozilla/pjs.git
clear mIsUtc when a non-null non-utc timezone is assigned, r=pav
This commit is contained in:
Родитель
436304e17b
Коммит
cd9f7e0286
|
@ -90,7 +90,8 @@ interface calIDateTime : nsISupports
|
|||
|
||||
// an associated timezone that's the preferred way of representing
|
||||
// this object. If this is null/empty, then there is no preferred
|
||||
// timezone, and UTC or localtime is assumed (based on isUtc).
|
||||
// timezone, and UTC or localtime is assumed (based on isUtc). If
|
||||
// this is non-null when assigned, isUtc is automatically cleared.
|
||||
attribute AUTF8String timezone;
|
||||
|
||||
// the offset in minutes from UTC that this date is stored in.
|
||||
|
|
|
@ -162,7 +162,23 @@ CAL_VALUETYPE_ATTR(calDateTime, PRInt32, TimezoneOffset)
|
|||
CAL_VALUETYPE_ATTR_GETTER(calDateTime, PRInt16, Weekday)
|
||||
CAL_VALUETYPE_ATTR_GETTER(calDateTime, PRInt16, Yearday)
|
||||
|
||||
CAL_STRINGTYPE_ATTR(calDateTime, nsACString, Timezone)
|
||||
CAL_STRINGTYPE_ATTR_GETTER(calDateTime, nsACString, Timezone)
|
||||
|
||||
NS_IMETHODIMP
|
||||
calDateTime::SetTimezone(const nsACString& aTimezone)
|
||||
{
|
||||
mTimezone.Assign(aTimezone);
|
||||
if (aTimezone.EqualsLiteral("UTC") ||
|
||||
aTimezone.EqualsLiteral("utc"))
|
||||
{
|
||||
mTimezone.Truncate();
|
||||
mIsUtc = PR_TRUE;
|
||||
} else if (!aTimezone.IsEmpty()) {
|
||||
mIsUtc = PR_FALSE;
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
calDateTime::GetNativeTime(PRTime *aResult)
|
||||
|
|
Загрузка…
Ссылка в новой задаче