Update change log and spec for wrt-plugins-tizen_0.2.84
[framework/web/wrt-plugins-tizen.git] / src / standards / Tizen / Calendar / JSCalendarRecurrenceRule.cpp
index 48a9bcd..0652d6f 100755 (executable)
@@ -256,19 +256,7 @@ JSValueRef JSCalendarRecurrenceRule::getProperty(JSContextRef context,
         } else if (JSStringIsEqualToUTF8CString(propertyName, TIZEN_RECURRENCE_RULE_SET_POSITION)) {
             return converter.toJSValueRef(rrule->getSetPosition());
         } else if (JSStringIsEqualToUTF8CString(propertyName, TIZEN_RECURRENCE_RULE_EXCEPTIONS)) {
-            JSObjectRef jsResult = JSCreateArrayObject(context, 0, NULL);
-            if (NULL == jsResult) {
-                ThrowMsg(NullPointerException, "Can not create array object.");
-            }
-
-            for (std::size_t i = 0; i < rrule->getExceptions().size(); ++i) {
-                JSValueRef tmpVal = timeConverter.toJSValueRefTZDate((double)(rrule->getExceptions().at(i)*1000.0), rrule->getTimeZone());
-                if (!JSSetArrayElement(context, jsResult, i, tmpVal)) {
-                    ThrowMsg(UnknownException, "Can not insert value into array.");
-                }
-            }
-
-            return jsResult;
+            return converter.toJSValueRef(rrule->getExceptions());
         }
     }
     Catch(Exception)
@@ -326,8 +314,7 @@ bool JSCalendarRecurrenceRule::setProperty(JSContextRef context,
             rrule->setDaysOfTheMonth(daysOfTheMonth);
             return true;*/
         } else if (JSStringIsEqualToUTF8CString(propertyName, TIZEN_RECURRENCE_RULE_DAYS_OF_THE_WEEK)) {
-            std::vector<std::string> daysOfTheWeek = converter.toVectorOfStrings(value);
-            rrule->setDaysOfTheWeek(daysOfTheWeek);
+            rrule->setDaysOfTheWeek(converter.toStringArray(value));
             return true;
         /*} else if (JSStringIsEqualToUTF8CString(propertyName, TIZEN_RECURRENCE_RULE_DAYS_OF_THE_YEAR)) {
             std::vector<int> daysOfTheYear = converter.toVectorOfInts(value);
@@ -344,8 +331,7 @@ bool JSCalendarRecurrenceRule::setProperty(JSContextRef context,
             rrule->setSetPosition(setPosition);*/
             return true;
         } else if (JSStringIsEqualToUTF8CString(propertyName, TIZEN_RECURRENCE_RULE_EXCEPTIONS)) {
-            // Only save the converted time info.
-            rrule->setExceptions(converter.toVectorOfTimeFromTZDate(value));
+            rrule->setExceptions(converter.toNumberArray(value));
             return true;
         }
     }