clear mIsUtc when a non-null non-utc timezone is assigned, r=pav

This commit is contained in:
vladimir%pobox.com 2005-04-29 23:11:17 +00:00
Родитель 436304e17b
Коммит cd9f7e0286
2 изменённых файлов: 19 добавлений и 2 удалений

Просмотреть файл

@ -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)