From ce0e01bda55141ea3828b565ccb2f758b672bf19 Mon Sep 17 00:00:00 2001 From: Kisub Song Date: Wed, 5 Sep 2012 22:46:02 +0900 Subject: [PATCH] Update change log and spec for wrt-plugins-tizen_0.2.78 Changed Modules : LBS, Time and Alarm [Version] 0.2.78 [Project] GT-I8800, Public [Title] SEL Verification [Team] WebAPI [BinType] PDA [Customer] Open [Issue#] N_SE-8909 N_SE-8951 [Problem] LBS - in kitchensink sampleApp, there is no action at pressing button [Cause] handle native error inproperly [Solution] handle error code properly [Issue#] N/A [Problem] Time - If changing timezone in setting after launching Webapp, the webapp can't get new timezone. [Cause] It is the limitation of ICU. [Solution] It'll register callback that is called when timezone is changed. If callback is called, it will set default timezone to changed timezone. [SCMRequest] N/A Change-Id: Ia9f22e69c8d57b9eaf782001fee472641f8bb0cb --- debian/changelog | 8 + packaging/wrt-plugins-tizen.spec | 2 +- src/platform/Tizen/TimeUtil/TZDate.cpp | 265 ++++++++++----------- src/platform/Tizen/TimeUtil/TimeUtil.cpp | 69 ++++-- src/platform/Tizen/TimeUtil/TimeUtil.h | 2 + src/platform/Tizen/TimeUtil/TimeUtilTools.cpp | 45 ++-- src/standards/Tizen/Alarm/JSAlarmManager.cpp | 69 +++--- .../Tizen/Geocoder/DefaultGeocoderProvider.cpp | 2 +- src/standards/Tizen/Geocoder/GeocoderProvider.h | 2 +- src/standards/Tizen/TimeUtil/JSTZDate.cpp | 86 +++---- src/standards/Tizen/TimeUtil/JSTimeUtil.cpp | 32 +-- src/standards/Tizen/TimeUtil/TimeUtilConverter.cpp | 38 +-- 12 files changed, 322 insertions(+), 298 deletions(-) diff --git a/debian/changelog b/debian/changelog index ad39c40..a5b3b52 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +wrt-plugins-tizen (0.2.78) unstable; urgency=low + + * Bug fix on LBS, Time and Alarm + * Git : slp/pkgs/w/wrt-plugins-tizen + * Tag : wrt-plugins-tizen_0.2.78 + + -- Kisub Song Wed, 05 Sep 2012 22:42:24 +0900 + wrt-plugins-tizen (0.2.77) unstable; urgency=low * Bug fix on Power and MediaContent diff --git a/packaging/wrt-plugins-tizen.spec b/packaging/wrt-plugins-tizen.spec index 760ad48..b02b639 100755 --- a/packaging/wrt-plugins-tizen.spec +++ b/packaging/wrt-plugins-tizen.spec @@ -1,6 +1,6 @@ Name: wrt-plugins-tizen Summary: JavaScript plugins for WebRuntime -Version: 0.2.77 +Version: 0.2.78 Release: 0 Group: TO_BE_FILLED License: TO_BE_FILLED diff --git a/src/platform/Tizen/TimeUtil/TZDate.cpp b/src/platform/Tizen/TimeUtil/TZDate.cpp index d93f8dd..cfb92d6 100755 --- a/src/platform/Tizen/TimeUtil/TZDate.cpp +++ b/src/platform/Tizen/TimeUtil/TZDate.cpp @@ -19,8 +19,6 @@ #include -#include - #include #include @@ -36,20 +34,20 @@ using namespace WrtDeviceApis; namespace TizenApis { namespace Platform { namespace TimeUtil { - + TZDate::TZDate(const bool isNotNull) { LogDebug("entered"); - + if (isNotNull == FALSE) { myCalendar = NULL; } else { UErrorCode ec = U_ZERO_ERROR; + TimeUtilTools util; myCalendar = Calendar::createInstance(ec); if (U_SUCCESS(ec)) { - TimeUtilTools Util; - Util.printDate(myCalendar); + util.printDate(myCalendar); } else { myCalendar = NULL; @@ -61,20 +59,19 @@ TZDate::TZDate(const bool isNotNull) TZDate::TZDate(const std::string &timezone) { LogDebug("entered"); - + UErrorCode ec = U_ZERO_ERROR; - TimeUtilTools Util; - myCalendar = Calendar::createInstance(Util.makeTimeZone(timezone) ,ec); + TimeUtilTools util; + myCalendar = Calendar::createInstance(util.makeTimeZone(timezone) ,ec); if (U_SUCCESS(ec)) { - TimeUtilTools Util; - Util.printDate(myCalendar); - if (!Util.compareTimeZoneName(myCalendar, timezone)) { + TimeUtilTools util; + util.printDate(myCalendar); + if (!util.compareTimeZoneName(myCalendar, timezone)) { myCalendar = NULL; ThrowMsg(Commons::InvalidArgumentException, "Unsupported Timezone."); } - } - else { + } else { myCalendar = NULL; ThrowMsg(Commons::PlatformException, "Can't make to ICU Calendar"); } @@ -85,29 +82,16 @@ TZDate::TZDate(const TZDateProperties &properties) { LogDebug("entered"); - UErrorCode ec = U_ZERO_ERROR; - TimeUtilTools Util; - if (properties.timezone == "") { - myCalendar = Calendar::createInstance(ec); - if (U_SUCCESS(ec)) { - myCalendar->set(Util.toint32_t(properties.year), Util.toint32_t(properties.month), - Util.toint32_t(properties.day), Util.toint32_t(properties.hours), Util.toint32_t(properties.minutes), Util.toint32_t(properties.seconds)); - set(TZDATE_MILLISECOND, properties.milliseconds); - } else { - myCalendar = NULL; - } - } else { - myCalendar = _makeCalendar(properties); - if (!Util.compareTimeZoneName(myCalendar, properties.timezone)) { - myCalendar = NULL; - ThrowMsg(Commons::InvalidArgumentException, "Unsupported Timezone."); - } + TimeUtilTools util; + myCalendar = _makeCalendar(properties); + if (!util.compareTimeZoneName(myCalendar, properties.timezone)) { + myCalendar = NULL; + ThrowMsg(Commons::InvalidArgumentException, "Unsupported Timezone."); } - if (myCalendar != NULL) { - Util.printDate(myCalendar); - } - else { + if (myCalendar != NULL) { + util.printDate(myCalendar); + } else { ThrowMsg(Commons::PlatformException, "Can't make to ICU Calendar"); } } @@ -120,14 +104,13 @@ TZDate::~TZDate() delete myCalendar; myCalendar = NULL; - } bool TZDate::isNull() { if (myCalendar == NULL) return TRUE; - + return FALSE; } @@ -135,13 +118,18 @@ Calendar *TZDate::_makeCalendar(const TZDateProperties &properties) { LogDebug("entered"); UErrorCode ec = U_ZERO_ERROR; - TimeUtilTools Util; - - Calendar *cal = Calendar::createInstance(Util.makeTimeZone(properties.timezone) ,ec); - if (U_SUCCESS(ec)) { - cal->set(Util.toint32_t(properties.year), Util.toint32_t(properties.month), - Util.toint32_t(properties.day), Util.toint32_t(properties.hours), Util.toint32_t(properties.minutes), Util.toint32_t(properties.seconds)); - cal->set(UCAL_MILLISECOND, Util.toint32_t(properties.milliseconds)); + TimeUtilTools util; + + Calendar *cal = NULL; + if (properties.timezone == "") + cal = Calendar::createInstance(ec); + else + cal = Calendar::createInstance(util.makeTimeZone(properties.timezone) ,ec); + + if ((cal != NULL) && U_SUCCESS(ec)) { + cal->set(util.toint32_t(properties.year), util.toint32_t(properties.month), + util.toint32_t(properties.day), util.toint32_t(properties.hours), util.toint32_t(properties.minutes), util.toint32_t(properties.seconds)); + cal->set(UCAL_MILLISECOND, util.toint32_t(properties.milliseconds)); return cal; } @@ -150,13 +138,13 @@ Calendar *TZDate::_makeCalendar(const TZDateProperties &properties) std::string TZDate::_getTimezoneName(Calendar *cal) { - UnicodeString ID; - TimeUtilTools Util; - - cal->getTimeZone().getID(ID); - std::string s_result = Util.toString(ID); + UnicodeString id; + TimeUtilTools util; + + cal->getTimeZone().getID(id); + std::string s_result = util.toString(id); LogDebug(s_result); - return s_result; + return s_result; } const UCalendarDateFields TZDate::_convertDateField(const TZDateFields field) @@ -188,13 +176,13 @@ const UCalendarDateFields TZDate::_convertDateField(const TZDateFields field) break; case TZDATE_DAY_OF_WEEK_IN_MONTH: return UCAL_DAY_OF_WEEK_IN_MONTH; - break; + break; case TZDATE_AM_PM: return UCAL_AM_PM; break; case TZDATE_HOUR: return UCAL_HOUR; - break; + break; case TZDATE_HOUR_OF_DAY: return UCAL_HOUR_OF_DAY; break; @@ -206,7 +194,7 @@ const UCalendarDateFields TZDate::_convertDateField(const TZDateFields field) break; case TZDATE_MILLISECOND: return UCAL_MILLISECOND; - break; + break; case TZDATE_ZONE_OFFSET: return UCAL_ZONE_OFFSET; break; @@ -221,8 +209,8 @@ const UCalendarDateFields TZDate::_convertDateField(const TZDateFields field) TZDateProperties TZDate::_makeProperties(Calendar *cal) { TZDateProperties result; - TimeUtilTools Util; - + TimeUtilTools util; + result.year = _get(TZDATE_YEAR, cal); result.month = _get(TZDATE_MONTH,cal); result.day = _get(TZDATE_DATE, cal); @@ -241,11 +229,11 @@ std::string TZDate::getTimezone() } TZDateProperties TZDate::toTimezone(const std::string timezone) { - TimeUtilTools Util; + TimeUtilTools util; Calendar *newCalendar = myCalendar->clone(); - newCalendar->setTimeZone(*(Util.makeTimeZone(timezone))); + newCalendar->setTimeZone(*(util.makeTimeZone(timezone))); - if (!Util.compareTimeZoneName(newCalendar, timezone)) { + if (!util.compareTimeZoneName(newCalendar, timezone)) { delete newCalendar; ThrowMsg(Commons::InvalidArgumentException, "Unsupported Timezone."); } @@ -266,10 +254,10 @@ long TZDate::_get(const TZDateFields field, Calendar *cal) } UErrorCode ec = U_ZERO_ERROR; - TimeUtilTools Util; + TimeUtilTools util; int32_t value = cal->get(_convertDateField(field), ec); if (U_SUCCESS(ec)) { - long result = Util.tolong(value); + long result = util.tolong(value); LogDebug(">>> result:" << result); return result; @@ -292,8 +280,8 @@ void TZDate::set(const TZDateFields field, const long value) if (_convertDateField(field) == UCAL_FIELD_COUNT) return; - TimeUtilTools Util; - myCalendar->set(_convertDateField(field), Util.toint32_t(value)); + TimeUtilTools util; + myCalendar->set(_convertDateField(field), util.toint32_t(value)); LogDebug("Field : " << field << " value : " << get(field)); } @@ -303,23 +291,23 @@ long TZDate::getUTC(const TZDateFields field) return -1; UErrorCode ec = U_ZERO_ERROR; - TimeUtilTools Util; + TimeUtilTools util; + + Calendar *utcCalendar = myCalendar->clone(); + utcCalendar->setTimeZone(*(TimeZone::getGMT())); - Calendar *UTCCalendar = myCalendar->clone(); - UTCCalendar->setTimeZone(*(TimeZone::getGMT())); + int32_t value = utcCalendar->get(_convertDateField(field), ec); + delete utcCalendar; - int32_t value = UTCCalendar->get(_convertDateField(field), ec); - delete UTCCalendar; - if (U_SUCCESS(ec)) { - long result = Util.tolong(value); + long result = util.tolong(value); if (field == TZDATE_DAY_OF_WEEK) result--; LogDebug("result : " << result); - + return result; } - + ThrowMsg(Commons::PlatformException, "Can't get UTC Calendar value"); return 0; } @@ -329,14 +317,14 @@ void TZDate::setUTC(const TZDateFields field, const long value) if (_convertDateField(field) == UCAL_FIELD_COUNT) return; - TimeUtilTools Util; + TimeUtilTools util; UErrorCode ec = U_ZERO_ERROR; long myValue = get(field); - long UTCValue = getUTC(field); + long utcValue = getUTC(field); if (field == TZDATE_DAY_OF_WEEK) - UTCValue++; - set(field, myValue + value - UTCValue); + utcValue++; + set(field, myValue + value - utcValue); if (!U_SUCCESS(ec)) ThrowMsg(Commons::PlatformException, "Can't set UTC Calendar value"); @@ -345,12 +333,12 @@ void TZDate::setUTC(const TZDateFields field, const long value) long long TZDate::difference(const TZDateProperties &prop) { LogDebug("entered"); - TimeUtilTools Util; + TimeUtilTools util; UErrorCode ec = U_ZERO_ERROR; - + Calendar *otherCalendar = _makeCalendar(prop); - if (!Util.compareTimeZoneName(otherCalendar, prop.timezone)) { + if (!util.compareTimeZoneName(otherCalendar, prop.timezone)) { delete otherCalendar; ThrowMsg(Commons::InvalidArgumentException, "Unsupported Timezone."); } @@ -361,14 +349,14 @@ long long TZDate::difference(const TZDateProperties &prop) { UDate otherTime = otherCalendar->getTime(ec); if (U_SUCCESS(ec)) { LogDebug("myCalendar"); - Util.printDate(myCalendar); + util.printDate(myCalendar); LogDebug("otherCalendar"); - Util.printDate(otherCalendar); + util.printDate(otherCalendar); delete otherCalendar; - + LogDebug("myTime : " <(myTime - otherTime); } } @@ -380,44 +368,43 @@ long long TZDate::difference(const TZDateProperties &prop) { TZDateProperties TZDate::addDuration(const DurationProperties &duration) { LogDebug("entered"); UErrorCode ec = U_ZERO_ERROR; - - TimeUtilTools Util; + + TimeUtilTools util; Calendar *cal = myCalendar->clone(); if (duration.unit == DAYS_UNIT) { - cal->add(UCAL_DATE, Util.toint32_t(duration.length), ec); + cal->add(UCAL_DATE, util.toint32_t(duration.length), ec); } else if (duration.unit == MINUTES_UNIT) { - cal->add(UCAL_MINUTE, Util.toint32_t(duration.length), ec); + cal->add(UCAL_MINUTE, util.toint32_t(duration.length), ec); } else if (duration.unit == HOURS_UNIT) { - cal->add(UCAL_HOUR_OF_DAY, Util.toint32_t(duration.length), ec); + cal->add(UCAL_HOUR_OF_DAY, util.toint32_t(duration.length), ec); } else if (duration.unit == MSECS_UNIT) { - cal->add(UCAL_MILLISECOND, Util.toint32_t(duration.length), ec); + cal->add(UCAL_MILLISECOND, util.toint32_t(duration.length), ec); } else { - cal->add(UCAL_SECOND, Util.toint32_t(duration.length), ec); + cal->add(UCAL_SECOND, util.toint32_t(duration.length), ec); } TZDateProperties result = _makeProperties(cal); - Util.printDate(cal); + util.printDate(cal); delete cal; if (!U_SUCCESS(ec)) ThrowMsg(Commons::PlatformException, "Calendar error in addDuration"); return result; - } TZDateProperties TZDate::toUTC() { LogDebug("entered"); - TimeUtilTools Util; + TimeUtilTools util; TZDateProperties result; - Calendar *UTCCalendar = myCalendar->clone(); + Calendar *utcCalendar = myCalendar->clone(); try { - UTCCalendar->setTimeZone(*(TimeZone::getGMT())); - result = _makeProperties(UTCCalendar); - Util.printDate(UTCCalendar); - delete UTCCalendar; + utcCalendar->setTimeZone(*(TimeZone::getGMT())); + result = _makeProperties(utcCalendar); + util.printDate(utcCalendar); + delete utcCalendar; } catch (Commons::PlatformException) { - delete UTCCalendar; + delete utcCalendar; ThrowMsg(Commons::PlatformException, "Calendar error in toUTC"); } @@ -426,14 +413,15 @@ TZDateProperties TZDate::toUTC() { TZDateProperties TZDate::toLocalTimezone() { LogDebug("entered"); - TimeUtilTools Util; + TimeUtilTools util; TZDateProperties result; Calendar *localCalendar = myCalendar->clone(); - + try { localCalendar->setTimeZone(*(TimeZone::createDefault())); + result = _makeProperties(localCalendar); - Util.printDate(localCalendar); + util.printDate(localCalendar); delete localCalendar; } catch (Commons::PlatformException) { delete localCalendar; @@ -468,18 +456,18 @@ bool TZDate::setTime(const double time) { std::string TZDate::toDateString(bool bLocale) { UErrorCode ec = U_ZERO_ERROR; UnicodeString str; - TimeUtilTools Util; - - DateFormat *fmt = new SimpleDateFormat(Util.getDateTimeFormat(TimeUtilTools::DATE_FORMAT, bLocale), (bLocale ? Locale::getDefault() : Locale::getEnglish()), ec); + TimeUtilTools util; + + DateFormat *fmt = new SimpleDateFormat(util.getDateTimeFormat(TimeUtilTools::DATE_FORMAT, bLocale), (bLocale ? Locale::getDefault() : Locale::getEnglish()), ec); if (U_SUCCESS(ec)) { fmt->setCalendar(*myCalendar); fmt->format(myCalendar->getTime(ec), str); delete fmt; if (U_SUCCESS(ec)) { - std::string result = Util.toString(str); + std::string result = util.toString(str); str.remove(); - + LogDebug (result); return result; } @@ -490,25 +478,24 @@ bool TZDate::setTime(const double time) { } std::string TZDate::toTimeString(bool bLocale) { - UErrorCode ec = U_ZERO_ERROR; UnicodeString str; - TimeUtilTools Util; - - DateFormat *fmt = new SimpleDateFormat(Util.getDateTimeFormat(TimeUtilTools::TIME_FORMAT, bLocale), (bLocale ? Locale::getDefault() : Locale::getEnglish()), ec); + TimeUtilTools util; + + DateFormat *fmt = new SimpleDateFormat(util.getDateTimeFormat(TimeUtilTools::TIME_FORMAT, bLocale), (bLocale ? Locale::getDefault() : Locale::getEnglish()), ec); if (U_SUCCESS(ec)) { fmt->setCalendar(*myCalendar); fmt->format(myCalendar->getTime(ec), str); delete fmt; if (U_SUCCESS(ec)) { - std::string result = Util.toString(str); + std::string result = util.toString(str); str.remove(); LogDebug (result); return result; } } - + ThrowMsg(Commons::PlatformException, "can't make SimpleDateFormat or can't get time"); return ""; } @@ -518,16 +505,16 @@ bool TZDate::setTime(const double time) { UErrorCode ec = U_ZERO_ERROR; UnicodeString str; - TimeUtilTools Util; - - DateFormat *fmt = new SimpleDateFormat(Util.getDateTimeFormat(TimeUtilTools::DATETIME_FORMAT, bLocale), (bLocale ? Locale::getDefault() : Locale::getEnglish()), ec); + TimeUtilTools util; + + DateFormat *fmt = new SimpleDateFormat(util.getDateTimeFormat(TimeUtilTools::DATETIME_FORMAT, bLocale), (bLocale ? Locale::getDefault() : Locale::getEnglish()), ec); if (U_SUCCESS(ec)) { fmt->setCalendar(*myCalendar); fmt->format(myCalendar->getTime(ec), str); delete fmt; if (U_SUCCESS(ec)) { - std::string result = Util.toString(str); + std::string result = util.toString(str); str.remove(); LogDebug (result); return result; @@ -542,8 +529,8 @@ std::string TZDate::getTimezoneAbbreviation() { UErrorCode ec = U_ZERO_ERROR; UnicodeString str; - TimeUtilTools Util; - + TimeUtilTools util; + DateFormat *fmt = new SimpleDateFormat(UnicodeString("V"), Locale::getEnglish(), ec); if (U_SUCCESS(ec)) { fmt->setCalendar(*myCalendar); @@ -551,7 +538,7 @@ std::string TZDate::getTimezoneAbbreviation() { delete fmt; if (U_SUCCESS(ec)) { - std::string result = Util.toString(str); + std::string result = util.toString(str); str.remove(); LogDebug (result); @@ -566,21 +553,21 @@ std::string TZDate::getTimezoneAbbreviation() { long TZDate::secondsFromUTC() { LogDebug("entered"); UErrorCode ec = U_ZERO_ERROR; - TimeUtilTools Util; + TimeUtilTools util; int32_t zoneOffset = myCalendar->get(UCAL_ZONE_OFFSET, ec); if (!U_SUCCESS(ec)) { ThrowMsg(Commons::PlatformException, "can't get zone offset"); return 0; } - + int32_t dstOffset = myCalendar->get(UCAL_DST_OFFSET, ec); if (!U_SUCCESS(ec)) { ThrowMsg(Commons::PlatformException, "can't get dst offset"); return 0; } - - long result = ( Util.tolong(zoneOffset + dstOffset)) / MILLISTOSEC; + + long result = ( util.tolong(zoneOffset + dstOffset)) / MILLISTOSEC; LogDebug("result : " << result); return result; @@ -589,7 +576,7 @@ long TZDate::secondsFromUTC() { bool TZDate::isDST() { LogDebug("entered"); UErrorCode ec = U_ZERO_ERROR; - TimeUtilTools Util; + TimeUtilTools util; UBool result = myCalendar->inDaylightTime(ec); if (!U_SUCCESS(ec)) { @@ -602,42 +589,42 @@ bool TZDate::isDST() { TZDateProperties TZDate::getDSTTransition(DSTTransition trans) { LogDebug("entered"); - TimeUtilTools Util; + TimeUtilTools util; UErrorCode ec = U_ZERO_ERROR; TZDateProperties props; - UDate DSTTransitionDate = myCalendar->getTime(ec); + UDate dstTransitionDate = myCalendar->getTime(ec); UBool result = false; if (U_SUCCESS(ec)) { - UnicodeString *ID = Util.toUnicodeString(getTimezone()); + UnicodeString *id = util.toUnicodeString(getTimezone()); - VTimeZone *Vtz = VTimeZone::createVTimeZoneByID(*ID); - delete ID; + VTimeZone *vtz = VTimeZone::createVTimeZoneByID(*id); + delete id; TimeZoneTransition tzTrans; - if (Vtz->useDaylightTime() == TRUE) { + if (vtz->useDaylightTime() == TRUE) { if (trans == NEXT_TRANSITION) - result = Vtz->getNextTransition(DSTTransitionDate, FALSE, tzTrans); + result = vtz->getNextTransition(dstTransitionDate, FALSE, tzTrans); else - result = Vtz->getPreviousTransition(DSTTransitionDate, FALSE, tzTrans); + result = vtz->getPreviousTransition(dstTransitionDate, FALSE, tzTrans); if (result == TRUE) { LogDebug("result is TRUE"); - DSTTransitionDate = tzTrans.getTime(); + dstTransitionDate = tzTrans.getTime(); } } - delete Vtz; + delete vtz; if (result == false) return props; - Calendar *DSTTransCalendar = myCalendar->clone(); - DSTTransCalendar->setTime(DSTTransitionDate, ec); + Calendar *dstTransCalendar = myCalendar->clone(); + dstTransCalendar->setTime(dstTransitionDate, ec); if (U_SUCCESS(ec)) { - props = _makeProperties(DSTTransCalendar); - delete DSTTransCalendar; + props = _makeProperties(dstTransCalendar); + delete dstTransCalendar; return props; } - delete DSTTransCalendar; + delete dstTransCalendar; } ThrowMsg(Commons::PlatformException, "can't getDSTTransition value from ICU"); return props; diff --git a/src/platform/Tizen/TimeUtil/TimeUtil.cpp b/src/platform/Tizen/TimeUtil/TimeUtil.cpp index 1f50a80..2d92381 100755 --- a/src/platform/Tizen/TimeUtil/TimeUtil.cpp +++ b/src/platform/Tizen/TimeUtil/TimeUtil.cpp @@ -41,15 +41,40 @@ namespace TizenApis { namespace Platform { namespace TimeUtil { +namespace { + static void changedTimezoneCallback(keynode_t* node, void* user_data) { + LogDebug("entered KeyName:" << vconf_keynode_get_name(node)); + if (!strcmp(vconf_keynode_get_name(node), VCONFKEY_SETAPPL_TIMEZONE_ID) && (vconf_keynode_get_type(node) == VCONF_TYPE_STRING)) { + char *timezoneID = vconf_keynode_get_str(node); + if (timezoneID != NULL) { + LogDebug("Changed Timezone : " << timezoneID); + TimeUtilTools util; + UnicodeString *id = util.toUnicodeString(timezoneID); + TimeZone *tz = TimeZone::createTimeZone(*id); + delete id; + + TimeZone::setDefault(*tz); + } + } + } +}//private namespace + TimeUtil::TimeUtil() { - LogDebug("entered"); + LogDebug("entered"); + bRegisteredChangedTimezone = false; + if (vconf_notify_key_changed(VCONFKEY_SETAPPL_TIMEZONE_ID, changedTimezoneCallback, NULL) == 0) { + LogDebug("Success to register changedTimezoneCallback"); + bRegisteredChangedTimezone = true; + } } TimeUtil::~TimeUtil() { - LogDebug("entered"); - + LogDebug("entered"); + if (bRegisteredChangedTimezone) { + vconf_ignore_key_changed(VCONFKEY_SETAPPL_TIMEZONE_ID, changedTimezoneCallback); + } } void TimeUtil::setCurrentTZDate(const TZDateProperties &tzdate){ @@ -61,14 +86,14 @@ std::string TimeUtil::getLocalTimezone() { UnicodeString idResult; TimeZone* zone = TimeZone::createDefault(); - UnicodeString ID; - zone->getID(ID); + UnicodeString id; + zone->getID(id); delete zone; - + try { - TimeUtilTools Util; - std::string s_result = Util.toString(ID); + TimeUtilTools util; + std::string s_result = util.toString(id); LogDebug("result : " << s_result); return s_result; @@ -83,14 +108,14 @@ std::string TimeUtil::getLocalTimezone() { std::string TimeUtil::getUTCTimezone() { LogDebug("entered"); - UnicodeString ID; - - const TimeZone *UTCTimezone = TimeZone::getGMT(); - UTCTimezone->getID(ID); + UnicodeString id; + + const TimeZone *utcTimezone = TimeZone::getGMT(); + utcTimezone->getID(id); try { - TimeUtilTools Util; - std::string s_result = Util.toString(ID); + TimeUtilTools util; + std::string s_result = util.toString(id); LogDebug("result : " << s_result); @@ -133,8 +158,8 @@ std::vector TimeUtil::getAvailableTimezones(){ std::string TimeUtil::getDateFormat(const bool b_shortFormat) { LogDebug("entered"); - TimeUtilTools Util; - UnicodeString timeFormat = Util.getDateTimeFormat((b_shortFormat ? TimeUtilTools::DATE_SHORT_FORMAT : TimeUtilTools::DATE_FORMAT), true); + TimeUtilTools util; + UnicodeString timeFormat = util.getDateTimeFormat((b_shortFormat ? TimeUtilTools::DATE_SHORT_FORMAT : TimeUtilTools::DATE_FORMAT), true); timeFormat = timeFormat.findAndReplace("E", "D"); if (timeFormat.indexOf("MMM") > 0) { @@ -154,14 +179,14 @@ std::string TimeUtil::getDateFormat(const bool b_shortFormat) { else i++; } - LogDebug("result : " << Util.toString(timeFormat)); - return Util.toString(timeFormat); + LogDebug("result : " << util.toString(timeFormat)); + return util.toString(timeFormat); } std::string TimeUtil::getTimeFormat(){ LogDebug("entered"); - TimeUtilTools Util; - UnicodeString timeFormat = Util.getDateTimeFormat(TimeUtilTools::TIME_FORMAT, true); + TimeUtilTools util; + UnicodeString timeFormat = util.getDateTimeFormat(TimeUtilTools::TIME_FORMAT, true); timeFormat = timeFormat.findAndReplace("H", "h"); timeFormat = timeFormat.findAndReplace("a", "ap"); @@ -173,8 +198,8 @@ std::string TimeUtil::getTimeFormat(){ else i++; } - LogDebug("result : " << Util.toString(timeFormat)); - return Util.toString(timeFormat); + LogDebug("result : " << util.toString(timeFormat)); + return util.toString(timeFormat); } } diff --git a/src/platform/Tizen/TimeUtil/TimeUtil.h b/src/platform/Tizen/TimeUtil/TimeUtil.h index c92fce8..ba2ab99 100755 --- a/src/platform/Tizen/TimeUtil/TimeUtil.h +++ b/src/platform/Tizen/TimeUtil/TimeUtil.h @@ -45,6 +45,8 @@ class TimeUtil : public ITimeUtil virtual std::vector getAvailableTimezones(); virtual std::string getDateFormat(const bool b_shortFormat); virtual std::string getTimeFormat(); + private: + bool bRegisteredChangedTimezone; }; } diff --git a/src/platform/Tizen/TimeUtil/TimeUtilTools.cpp b/src/platform/Tizen/TimeUtil/TimeUtilTools.cpp index 98f0110..7175feb 100755 --- a/src/platform/Tizen/TimeUtil/TimeUtilTools.cpp +++ b/src/platform/Tizen/TimeUtil/TimeUtilTools.cpp @@ -57,9 +57,9 @@ int32_t TimeUtilTools::toint32_t(const int num) UnicodeString *TimeUtilTools::toUnicodeString(const std::string str) { - UnicodeString *ID = new UnicodeString(str.c_str()); + UnicodeString *id = new UnicodeString(str.c_str()); - return ID; + return id; } std::string TimeUtilTools::toString(UnicodeString uniStr) @@ -83,18 +83,18 @@ TimeZone *TimeUtilTools::makeTimeZone(const std::string &name) { LogDebug("entered timezone name : " << name); - UnicodeString *ID = toUnicodeString(name); + UnicodeString *id = toUnicodeString(name); + + TimeZone *tz = TimeZone::createTimeZone(*id); + delete id; - TimeZone *tz = TimeZone::createTimeZone(*ID); - delete ID; - return tz; } bool TimeUtilTools::compareTimeZoneName(Calendar *cal, const std::string &name) { - UnicodeString ID; - cal->getTimeZone().getID(ID); - std::string timezone = toString(ID); + UnicodeString id; + cal->getTimeZone().getID(id); + std::string timezone = toString(id); if ((timezone != name) && (timezone == "Etc/Unknown")) return false; @@ -143,24 +143,23 @@ UnicodeString TimeUtilTools::getDateTimeFormat(DateTimeFormatType type, bool bLo void TimeUtilTools::printDate(Calendar *cal) { UErrorCode ec = U_ZERO_ERROR; - TimeUtilTools Util; if (cal == NULL) return; - LogDebug("year : " << Util.tolong(cal->get(UCAL_YEAR, ec))); - LogDebug("month : " << Util.tolong(cal->get(UCAL_MONTH, ec))); - LogDebug("day : " << Util.tolong(cal->get(UCAL_DATE, ec))); - LogDebug("hours : " << Util.tolong(cal->get(UCAL_HOUR, ec))); - LogDebug("hours of day : " << Util.tolong(cal->get(UCAL_HOUR_OF_DAY, ec))); - LogDebug("AM/PM : " << Util.tolong(cal->get(UCAL_AM_PM, ec))); - LogDebug("dayofweek : " << Util.tolong(cal->get(UCAL_DAY_OF_WEEK, ec))); - LogDebug("minues : " << Util.tolong(cal->get(UCAL_MINUTE, ec))); - LogDebug("seconds : " << Util.tolong(cal->get(UCAL_SECOND, ec))); - LogDebug("miliseconds : " << Util.tolong(cal->get(UCAL_MILLISECOND, ec))); - LogDebug("zone offset : " << Util.tolong(cal->get(UCAL_ZONE_OFFSET, ec))); - LogDebug("dst offset : " << Util.tolong(cal->get(UCAL_DST_OFFSET, ec))); - LogDebug("is leap month? : " << Util.tolong(cal->get(UCAL_IS_LEAP_MONTH, ec))); + LogDebug("year : " << tolong(cal->get(UCAL_YEAR, ec))); + LogDebug("month : " << tolong(cal->get(UCAL_MONTH, ec))); + LogDebug("day : " << tolong(cal->get(UCAL_DATE, ec))); + LogDebug("hours : " << tolong(cal->get(UCAL_HOUR, ec))); + LogDebug("hours of day : " << tolong(cal->get(UCAL_HOUR_OF_DAY, ec))); + LogDebug("AM/PM : " << tolong(cal->get(UCAL_AM_PM, ec))); + LogDebug("dayofweek : " << tolong(cal->get(UCAL_DAY_OF_WEEK, ec))); + LogDebug("minues : " << tolong(cal->get(UCAL_MINUTE, ec))); + LogDebug("seconds : " << tolong(cal->get(UCAL_SECOND, ec))); + LogDebug("miliseconds : " << tolong(cal->get(UCAL_MILLISECOND, ec))); + LogDebug("zone offset : " << tolong(cal->get(UCAL_ZONE_OFFSET, ec))); + LogDebug("dst offset : " << tolong(cal->get(UCAL_DST_OFFSET, ec))); + LogDebug("is leap month? : " << tolong(cal->get(UCAL_IS_LEAP_MONTH, ec))); } } diff --git a/src/standards/Tizen/Alarm/JSAlarmManager.cpp b/src/standards/Tizen/Alarm/JSAlarmManager.cpp index 1cfa637..c4be10c 100755 --- a/src/standards/Tizen/Alarm/JSAlarmManager.cpp +++ b/src/standards/Tizen/Alarm/JSAlarmManager.cpp @@ -351,46 +351,48 @@ JSValueRef JSAlarmManager::getAll(JSContextRef ctx, JSObjectRef object, JSObject std::vector alarmIds; Try { - error = alarm_foreach_registered_alarm(alarm_iterate_callback, &alarmIds); + error = alarm_foreach_registered_alarm(alarm_iterate_callback, &alarmIds); if(error != ALARM_ERROR_NONE) { - LogInfo("Error occurred while getting all alarms: "<setTime(milliseconds)) + if (!tzDate->setTime(milliseconds)) ThrowMsg(UnknownException, "Can not set UTC Time"); - TZDatePrivObject *priv = new TZDatePrivObject(context, TZDate); + TZDatePrivObject *priv = new TZDatePrivObject(context, tzDate); if (!priv) { ThrowMsg(NullPointerException, "Can not new an object"); } @@ -176,9 +176,9 @@ JSObjectRef JSTZDate::createJSObject(JSContextRef context, const double millisec JSObjectRef JSTZDate::createJSObject(JSContextRef context, const TZDateProperties &properties) { LogDebug("entered"); - ITZDatePtr TZDate = TimeUtilFactory::getInstance().createTZDateObject(properties); + ITZDatePtr tzDate = TimeUtilFactory::getInstance().createTZDateObject(properties); - TZDatePrivObject *priv = new TZDatePrivObject(context, TZDate); + TZDatePrivObject *priv = new TZDatePrivObject(context, tzDate); if (!priv) { ThrowMsg(NullPointerException, "Can not new an object"); } @@ -209,8 +209,8 @@ void JSTZDate::initialize(JSContextRef context, JSObjectRef object) if (!JSObjectGetPrivate(object)) { LogDebug("Private object not set... setting it."); - ITZDatePtr TZDate = TimeUtilFactory::getInstance().createTZDateObject(FALSE); - TZDatePrivObject *priv = new TZDatePrivObject(context, TZDate); + ITZDatePtr tzDate = TimeUtilFactory::getInstance().createTZDateObject(FALSE); + TZDatePrivObject *priv = new TZDatePrivObject(context, tzDate); if (!JSObjectSetPrivate(object, priv)) { delete priv; } @@ -350,8 +350,8 @@ JSValueRef JSTZDate::getTimezone(JSContextRef context, JSObjectRef function, ThrowMsg(NullPointerException, "Private object not initialized"); } - ITZDatePtr TZDate(privateObject->getObject()); - std::string timezone = TZDate->getTimezone(); + ITZDatePtr tzDate(privateObject->getObject()); + std::string timezone = tzDate->getTimezone(); TimeUtilConverter converter(context); return converter.toJSValueRef(timezone); @@ -394,8 +394,8 @@ JSValueRef JSTZDate::toTimezone(JSContextRef context, JSObjectRef function, ThrowMsg(NullPointerException, "Private object not initialized"); } - ITZDatePtr TZDate(privateObject->getObject()); - return createJSObject(context, TZDate->toTimezone(timezone)); + ITZDatePtr tzDate(privateObject->getObject()); + return createJSObject(context, tzDate->toTimezone(timezone)); } Catch(NullPointerException) { LogError("Exception: " << _rethrown_exception.GetMessage()); return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch"); @@ -425,8 +425,8 @@ JSValueRef JSTZDate::diffTZDate(JSContextRef context, JSObjectRef thisObject, si if ((argumentCount < 1) || JSValueIsNull(context, arguments[0]) || JSValueIsUndefined(context, arguments[0]) || !JSValueIsObjectOfClass(context, arguments[0], getClassRef())) { - LogError("Wrong TZDate parameters"); - ThrowMsg(ConversionException, "Wrong TZDate parameters"); + LogError("Wrong tzDate parameters"); + ThrowMsg(ConversionException, "Wrong tzDate parameters"); } TZDatePrivObject* privateObject = static_cast(JSObjectGetPrivate(thisObject)); @@ -435,8 +435,8 @@ JSValueRef JSTZDate::diffTZDate(JSContextRef context, JSObjectRef thisObject, si ThrowMsg(NullPointerException, "Private object not initialized"); } TimeUtilConverter converter(context); - ITZDatePtr TZDate(privateObject->getObject()); - long long cmpResult = TZDate->difference(converter.getPropertiesInTZDate(arguments[0])); + ITZDatePtr tzDate(privateObject->getObject()); + long long cmpResult = tzDate->difference(converter.getPropertiesInTZDate(arguments[0])); switch (type) { case EQUALSTO: @@ -593,8 +593,8 @@ JSValueRef JSTZDate::addDuration(JSContextRef context, JSObjectRef function, ThrowMsg(NullPointerException, "Private object not initialized"); } - ITZDatePtr TZDate(privateObject->getObject()); - TZDateProperties result = TZDate->addDuration(duration); + ITZDatePtr tzDate(privateObject->getObject()); + TZDateProperties result = tzDate->addDuration(duration); return (static_cast(createJSObject(context, result))); } Catch(NullPointerException) { LogError("Exception: " << _rethrown_exception.GetMessage()); @@ -630,8 +630,8 @@ JSValueRef JSTZDate::toUTC(JSContextRef context, JSObjectRef function, ThrowMsg(NullPointerException, "Private object not initialized"); } - ITZDatePtr TZDate(privateObject->getObject()); - TZDateProperties result = TZDate->toUTC(); + ITZDatePtr tzDate(privateObject->getObject()); + TZDateProperties result = tzDate->toUTC(); return (static_cast(createJSObject(context, result))); } Catch(NullPointerException) { LogError("Exception: " << _rethrown_exception.GetMessage()); @@ -665,8 +665,8 @@ JSValueRef JSTZDate::toLocalTimezone(JSContextRef context, JSObjectRef function, ThrowMsg(NullPointerException, "Private object not initialized"); } - ITZDatePtr TZDate(privateObject->getObject()); - TZDateProperties result = TZDate->toLocalTimezone(); + ITZDatePtr tzDate(privateObject->getObject()); + TZDateProperties result = tzDate->toLocalTimezone(); return (static_cast(createJSObject(context, result))); } Catch(NullPointerException) { LogError("Exception: " << _rethrown_exception.GetMessage()); @@ -700,8 +700,8 @@ JSValueRef JSTZDate::toLocaleDateString(JSContextRef context, JSObjectRef functi TimeUtilConverter converter(context); - ITZDatePtr TZDate(privateObject->getObject()); - std::string result = TZDate->toDateString(true); + ITZDatePtr tzDate(privateObject->getObject()); + std::string result = tzDate->toDateString(true); return converter.toJSValueRef(result); } Catch(NullPointerException) { LogError("Exception: " << _rethrown_exception.GetMessage()); @@ -736,8 +736,8 @@ JSValueRef JSTZDate::toLocaleTimeString(JSContextRef context, JSObjectRef functi TimeUtilConverter converter(context); - ITZDatePtr TZDate(privateObject->getObject()); - std::string result = TZDate->toTimeString(true); + ITZDatePtr tzDate(privateObject->getObject()); + std::string result = tzDate->toTimeString(true); return converter.toJSValueRef(result); } Catch(NullPointerException) { LogError("Exception: " << _rethrown_exception.GetMessage()); @@ -772,8 +772,8 @@ JSValueRef JSTZDate::toLocaleString(JSContextRef context, JSObjectRef function, TimeUtilConverter converter(context); - ITZDatePtr TZDate(privateObject->getObject()); - std::string result = TZDate->toString(true); + ITZDatePtr tzDate(privateObject->getObject()); + std::string result = tzDate->toString(true); return converter.toJSValueRef(result); } Catch(NullPointerException) { LogError("Exception: " << _rethrown_exception.GetMessage()); @@ -808,8 +808,8 @@ JSValueRef JSTZDate::toDateString(JSContextRef context, JSObjectRef function, TimeUtilConverter converter(context); - ITZDatePtr TZDate(privateObject->getObject()); - std::string result = TZDate->toDateString(); + ITZDatePtr tzDate(privateObject->getObject()); + std::string result = tzDate->toDateString(); return converter.toJSValueRef(result); } Catch(NullPointerException) { LogError("Exception: " << _rethrown_exception.GetMessage()); @@ -844,8 +844,8 @@ JSValueRef JSTZDate::toTimeString(JSContextRef context, JSObjectRef function, TimeUtilConverter converter(context); - ITZDatePtr TZDate(privateObject->getObject()); - std::string result = TZDate->toTimeString(); + ITZDatePtr tzDate(privateObject->getObject()); + std::string result = tzDate->toTimeString(); return converter.toJSValueRef(result); } Catch(NullPointerException) { LogError("Exception: " << _rethrown_exception.GetMessage()); @@ -881,8 +881,8 @@ JSValueRef JSTZDate::toString(JSContextRef context, JSObjectRef function, TimeUtilConverter converter(context); - ITZDatePtr TZDate(privateObject->getObject()); - std::string result = TZDate->toString(); + ITZDatePtr tzDate(privateObject->getObject()); + std::string result = tzDate->toString(); return converter.toJSValueRef(result); } Catch(NullPointerException) { LogError("Exception: " << _rethrown_exception.GetMessage()); @@ -1292,8 +1292,8 @@ JSValueRef JSTZDate::getUTCTZDateValue(JSContextRef context, JSObjectRef thisObj TimeUtilConverter converter(context); - ITZDatePtr TZDate(privateObject->getObject()); - long result = TZDate->getUTC(DateFields); + ITZDatePtr tzDate(privateObject->getObject()); + long result = tzDate->getUTC(DateFields); return converter.toJSValueRefLong(result); } Catch(NullPointerException) { @@ -1387,8 +1387,8 @@ JSValueRef JSTZDate::setUTCTZDateValue(JSContextRef context, JSObjectRef thisObj ThrowMsg(NullPointerException, "Private object not initialized"); } - ITZDatePtr TZDate(privateObject->getObject()); - TZDate->setUTC(dateFields, data); + ITZDatePtr tzDate(privateObject->getObject()); + tzDate->setUTC(dateFields, data); return JSValueMakeNull(context); } Catch(NullPointerException) { diff --git a/src/standards/Tizen/TimeUtil/JSTimeUtil.cpp b/src/standards/Tizen/TimeUtil/JSTimeUtil.cpp index c76cb2a..b1118d3 100755 --- a/src/standards/Tizen/TimeUtil/JSTimeUtil.cpp +++ b/src/standards/Tizen/TimeUtil/JSTimeUtil.cpp @@ -90,8 +90,8 @@ void JSTimeUtil::initialize(JSContextRef context, JSObjectRef object) { TimeUtilPrivObject* priv = static_cast(JSObjectGetPrivate(object)); if (!priv) { - ITimeUtilPtr TimeUtil( TimeUtilFactory::getInstance().createTimeUtilObject() ); - priv = new TimeUtilPrivObject( context, TimeUtil); + ITimeUtilPtr timeutil( TimeUtilFactory::getInstance().createTimeUtilObject() ); + priv = new TimeUtilPrivObject( context, timeutil); if(!JSObjectSetPrivate(object, static_cast(priv))) { LogError("Object can't store private data."); delete priv; @@ -105,7 +105,7 @@ void JSTimeUtil::finalize(JSObjectRef object) { TimeUtilPrivObject* priv = static_cast(JSObjectGetPrivate(object)); JSObjectSetPrivate(object, NULL); - LogDebug("Deleting TimeUtil"); + LogDebug("Deleting timeutil"); delete priv; } @@ -179,11 +179,11 @@ JSValueRef JSTimeUtil::setCurrentDateTime(JSContextRef context, return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch"); } - ITimeUtilPtr TimeUtil(privateObject->getObject()); - - TZDateProperties TZDate = converter.getPropertiesInTZDate(arguments[0]); - - TimeUtil->setCurrentTZDate(TZDate); + ITimeUtilPtr timeutil(privateObject->getObject()); + + TZDateProperties tzDate = converter.getPropertiesInTZDate(arguments[0]); + + timeutil->setCurrentTZDate(tzDate); return JSValueMakeNull(context); } Catch(ConversionException) { @@ -219,8 +219,8 @@ JSValueRef JSTimeUtil::getLocalTimezone(JSContextRef context, ThrowMsg(NullPointerException, "Can not new an object"); } - ITimeUtilPtr TimeUtil(privateObject->getObject()); - std::string localTimezone = TimeUtil->getLocalTimezone(); + ITimeUtilPtr timeutil(privateObject->getObject()); + std::string localTimezone = timeutil->getLocalTimezone(); TimeUtilConverter converter(context); @@ -261,9 +261,9 @@ JSValueRef JSTimeUtil::getAvailableTimezones(JSContextRef context, TimeUtilConverter converter(context); - ITimeUtilPtr TimeUtil(privateObject->getObject()); + ITimeUtilPtr timeutil(privateObject->getObject()); - std::vector timezones = TimeUtil->getAvailableTimezones(); + std::vector timezones = timeutil->getAvailableTimezones(); std::vector timezonesArray; unsigned short timezonesCount = timezones.size(); for (int i = 0; i < timezonesCount; ++i) { @@ -318,8 +318,8 @@ JSValueRef JSTimeUtil::getDateFormat(JSContextRef context, ThrowMsg(NullPointerException, "Can not new an object"); } - ITimeUtilPtr TimeUtil(privateObject->getObject()); - std::string dateformat = TimeUtil->getDateFormat(b_shortFormat); + ITimeUtilPtr timeutil(privateObject->getObject()); + std::string dateformat = timeutil->getDateFormat(b_shortFormat); return converter.toJSValueRef(dateformat); } Catch(ConversionException) { @@ -364,8 +364,8 @@ JSValueRef JSTimeUtil::getTimeFormat(JSContextRef context, ThrowMsg(NullPointerException, "Can not new an object"); } - ITimeUtilPtr TimeUtil(privateObject->getObject()); - std::string timeFormat = TimeUtil->getTimeFormat(); + ITimeUtilPtr timeutil(privateObject->getObject()); + std::string timeFormat = timeutil->getTimeFormat(); TimeUtilConverter converter(context); return converter.toJSValueRef(timeFormat); diff --git a/src/standards/Tizen/TimeUtil/TimeUtilConverter.cpp b/src/standards/Tizen/TimeUtil/TimeUtilConverter.cpp index 5ecdf43..c3e1f14 100755 --- a/src/standards/Tizen/TimeUtil/TimeUtilConverter.cpp +++ b/src/standards/Tizen/TimeUtil/TimeUtilConverter.cpp @@ -72,17 +72,17 @@ TZDateProperties TimeUtilConverter::getPropertiesInTZDate(JSObjectRef arg) { ThrowMsg(Commons::ConversionException, "Private object not initialized"); } - ITZDatePtr TZDate = privateObject->getObject(); + ITZDatePtr tzDate = privateObject->getObject(); TZDateProperties result; - result.timezone = TZDate->getTimezone(); - result.year = TZDate->get(ITZDate::TZDATE_YEAR); - result.month = TZDate->get(ITZDate::TZDATE_MONTH); - result.day= TZDate->get(ITZDate::TZDATE_DATE); - result.hours= TZDate->get(ITZDate::TZDATE_HOUR_OF_DAY); - result.minutes= TZDate->get(ITZDate::TZDATE_MINUTE); - result.seconds= TZDate->get(ITZDate::TZDATE_SECOND); - result.milliseconds = TZDate->get(ITZDate::TZDATE_MILLISECOND); + result.timezone = tzDate->getTimezone(); + result.year = tzDate->get(ITZDate::TZDATE_YEAR); + result.month = tzDate->get(ITZDate::TZDATE_MONTH); + result.day= tzDate->get(ITZDate::TZDATE_DATE); + result.hours= tzDate->get(ITZDate::TZDATE_HOUR_OF_DAY); + result.minutes= tzDate->get(ITZDate::TZDATE_MINUTE); + result.seconds= tzDate->get(ITZDate::TZDATE_SECOND); + result.milliseconds = tzDate->get(ITZDate::TZDATE_MILLISECOND); return result; } @@ -235,9 +235,9 @@ double TimeUtilConverter::getTimeInMilliseconds(JSObjectRef arg) { ThrowMsg(Commons::ConversionException, "Private object not initialized"); } - ITZDatePtr TZDate = privateObject->getObject(); + ITZDatePtr tzDate = privateObject->getObject(); - return TZDate->getTime(); + return tzDate->getTime(); } tm TimeUtilConverter::toTZDateTime(JSValueRef arg) { @@ -262,17 +262,17 @@ tm TimeUtilConverter::toTZDateTime(JSObjectRef arg) { ThrowMsg(Commons::ConversionException, "Private object not initialized"); } - ITZDatePtr TZDate = privateObject->getObject(); + ITZDatePtr tzDate = privateObject->getObject(); - TZDateProperties UTCProperties = TZDate->toUTC(); + TZDateProperties utcProperties = tzDate->toUTC(); struct tm utcTm; - utcTm.tm_year = UTCProperties.year - 1900; - utcTm.tm_mon = UTCProperties.month; - utcTm.tm_mday= UTCProperties.day; - utcTm.tm_hour= UTCProperties.hours; - utcTm.tm_min=UTCProperties.minutes; - utcTm.tm_sec= UTCProperties.seconds; + utcTm.tm_year = utcProperties.year - 1900; + utcTm.tm_mon = utcProperties.month; + utcTm.tm_mday= utcProperties.day; + utcTm.tm_hour= utcProperties.hours; + utcTm.tm_min=utcProperties.minutes; + utcTm.tm_sec= utcProperties.seconds; utcTm.tm_isdst = 0; return utcTm; } -- 2.7.4