зеркало из https://github.com/mozilla/pjs.git
calendar build fixes; also updated datetime impl for timezone handling on nativetime set
This commit is contained in:
Родитель
affa5bee17
Коммит
cd2985f54b
|
@ -64,4 +64,16 @@ CPPSRCS = calBaseModule.cpp \
|
|||
LOCAL_INCLUDES = \
|
||||
-I$(srcdir)/../src
|
||||
|
||||
SHARED_LIBRARY_LIBS = \
|
||||
$(DIST)/lib/$(LIB_PREFIX)calbase_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)mozical.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)mozicalss.$(LIB_SUFFIX) \
|
||||
$(NULL)
|
||||
|
||||
EXTRA_DSO_LDOPTS += \
|
||||
$(LIBS_DIR) \
|
||||
$(EXTRA_DSO_LIBS) \
|
||||
$(MOZ_COMPONENT_LIBS) \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
|
|
@ -89,9 +89,9 @@ interface calIDateTime : nsISupports
|
|||
attribute PRBool isUtc;
|
||||
|
||||
// an associated timezone that's the preferred way of representing
|
||||
// this object. If this is null, then there is no preferred
|
||||
// this object. If this is null/empty, then there is no preferred
|
||||
// timezone, and UTC or localtime is assumed (based on isUtc).
|
||||
attribute string timezone;
|
||||
attribute AUTF8String timezone;
|
||||
|
||||
//
|
||||
// computed values
|
||||
|
|
|
@ -47,9 +47,19 @@ extern "C" {
|
|||
NS_IMPL_ISUPPORTS1(calDateTime, calIDateTime)
|
||||
|
||||
calDateTime::calDateTime()
|
||||
: mValid(PR_FALSE)
|
||||
: mImmutable(PR_FALSE),
|
||||
mValid(PR_FALSE)
|
||||
{
|
||||
|
||||
mNativeTime = 0;
|
||||
mYear = 0;
|
||||
mMonth = 0;
|
||||
mDay = 0;
|
||||
mHour = 0;
|
||||
mMinute = 0;
|
||||
mSecond = 0;
|
||||
mIsUtc = PR_FALSE;
|
||||
mWeekday = 0;
|
||||
mYearday = 0;
|
||||
}
|
||||
|
||||
calDateTime::calDateTime(struct icaltimetype *atimeptr)
|
||||
|
@ -108,7 +118,6 @@ calDateTime::Clone(calIDateTime **aResult)
|
|||
|
||||
CAL_VALUETYPE_ATTR_GETTER(calDateTime, PRBool, Valid)
|
||||
|
||||
CAL_VALUETYPE_ATTR(calDateTime, PRTime, NativeTime)
|
||||
CAL_VALUETYPE_ATTR(calDateTime, PRInt16, Year)
|
||||
CAL_VALUETYPE_ATTR(calDateTime, PRInt16, Month)
|
||||
CAL_VALUETYPE_ATTR(calDateTime, PRInt16, Day)
|
||||
|
@ -120,6 +129,27 @@ CAL_VALUETYPE_ATTR(calDateTime, PRBool, IsUtc)
|
|||
CAL_VALUETYPE_ATTR_GETTER(calDateTime, PRInt16, Weekday)
|
||||
CAL_VALUETYPE_ATTR_GETTER(calDateTime, PRInt16, Yearday)
|
||||
|
||||
CAL_STRINGTYPE_ATTR(calDateTime, nsACString, Timezone)
|
||||
|
||||
NS_IMETHODIMP
|
||||
calDateTime::GetNativeTime(PRTime *aResult)
|
||||
{
|
||||
*aResult = mNativeTime;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
calDateTime::SetNativeTime(PRTime aNativeTime)
|
||||
{
|
||||
if (mIsUtc) {
|
||||
return SetTimeInTimezone (aNativeTime, "UTC");
|
||||
} else if (!mTimezone.IsEmpty()) {
|
||||
return SetTimeInTimezone (aNativeTime, mTimezone.get());
|
||||
} else {
|
||||
return SetTimeInTimezone (aNativeTime, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
calDateTime::Normalize()
|
||||
{
|
||||
|
|
|
@ -72,6 +72,7 @@ protected:
|
|||
PRInt16 mSecond;
|
||||
|
||||
PRBool mIsUtc;
|
||||
nsCString mTimezone;
|
||||
|
||||
PRInt16 mWeekday;
|
||||
PRInt16 mYearday;
|
||||
|
|
Загрузка…
Ссылка в новой задаче