* added support for all the different names (std/dst, long/short) and daylight
support to BTimeZone git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37933 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -16,7 +16,11 @@ public:
|
|||||||
|
|
||||||
const BString& Code() const;
|
const BString& Code() const;
|
||||||
const BString& Name() const;
|
const BString& Name() const;
|
||||||
|
const BString& DaylightSavingName() const;
|
||||||
|
const BString& ShortName() const;
|
||||||
|
const BString& ShortDaylightSavingName() const;
|
||||||
int OffsetFromGMT() const;
|
int OffsetFromGMT() const;
|
||||||
|
bool SupportsDaylightSaving() const;
|
||||||
|
|
||||||
status_t InitCheck() const;
|
status_t InitCheck() const;
|
||||||
|
|
||||||
@@ -27,7 +31,11 @@ public:
|
|||||||
private:
|
private:
|
||||||
BString fCode;
|
BString fCode;
|
||||||
BString fName;
|
BString fName;
|
||||||
|
BString fDaylightSavingName;
|
||||||
|
BString fShortName;
|
||||||
|
BString fShortDaylightSavingName;
|
||||||
int fOffsetFromGMT;
|
int fOffsetFromGMT;
|
||||||
|
bool fSupportsDaylightSaving;
|
||||||
|
|
||||||
status_t fInitStatus;
|
status_t fInitStatus;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -35,6 +35,27 @@ BTimeZone::Name() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const BString&
|
||||||
|
BTimeZone::DaylightSavingName() const
|
||||||
|
{
|
||||||
|
return fDaylightSavingName;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const BString&
|
||||||
|
BTimeZone::ShortName() const
|
||||||
|
{
|
||||||
|
return fShortName;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const BString&
|
||||||
|
BTimeZone::ShortDaylightSavingName() const
|
||||||
|
{
|
||||||
|
return fShortDaylightSavingName;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const BString&
|
const BString&
|
||||||
BTimeZone::Code() const
|
BTimeZone::Code() const
|
||||||
{
|
{
|
||||||
@@ -49,6 +70,13 @@ BTimeZone::OffsetFromGMT() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool
|
||||||
|
BTimeZone::SupportsDaylightSaving() const
|
||||||
|
{
|
||||||
|
return fSupportsDaylightSaving;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
BTimeZone::InitCheck() const
|
BTimeZone::InitCheck() const
|
||||||
{
|
{
|
||||||
@@ -71,10 +99,27 @@ BTimeZone::SetTo(const char* zoneCode)
|
|||||||
unicodeString.toUTF8(converter);
|
unicodeString.toUTF8(converter);
|
||||||
|
|
||||||
unicodeString.remove();
|
unicodeString.remove();
|
||||||
icuTimeZone->getDisplayName(unicodeString);
|
icuTimeZone->getDisplayName(false, TimeZone::LONG, unicodeString);
|
||||||
converter.SetTo(&fName);
|
converter.SetTo(&fName);
|
||||||
unicodeString.toUTF8(converter);
|
unicodeString.toUTF8(converter);
|
||||||
|
|
||||||
|
unicodeString.remove();
|
||||||
|
icuTimeZone->getDisplayName(true, TimeZone::LONG, unicodeString);
|
||||||
|
converter.SetTo(&fDaylightSavingName);
|
||||||
|
unicodeString.toUTF8(converter);
|
||||||
|
|
||||||
|
unicodeString.remove();
|
||||||
|
icuTimeZone->getDisplayName(false, TimeZone::SHORT, unicodeString);
|
||||||
|
converter.SetTo(&fShortName);
|
||||||
|
unicodeString.toUTF8(converter);
|
||||||
|
|
||||||
|
unicodeString.remove();
|
||||||
|
icuTimeZone->getDisplayName(true, TimeZone::SHORT, unicodeString);
|
||||||
|
converter.SetTo(&fShortDaylightSavingName);
|
||||||
|
unicodeString.toUTF8(converter);
|
||||||
|
|
||||||
|
fSupportsDaylightSaving = icuTimeZone->useDaylightTime();
|
||||||
|
|
||||||
int32_t rawOffset;
|
int32_t rawOffset;
|
||||||
int32_t dstOffset;
|
int32_t dstOffset;
|
||||||
UDate nowMillis = 1000 * (double)time(NULL);
|
UDate nowMillis = 1000 * (double)time(NULL);
|
||||||
|
|||||||
Reference in New Issue
Block a user