summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhs321.lee <hs321.lee@samsung.com>2013-09-16 22:07:11 +0900
committerhs321.lee <hs321.lee@samsung.com>2013-11-22 15:53:28 +0900
commit0fe574d93d3994e2456c92db3654c9785376dcfa (patch)
treef7d1539c6ed71320f5ae5c84b2e7990497683c5f
parent9d020a8cb3e93dd4f477854547755c3c4523a7b5 (diff)
downloadsocial-0fe574d93d3994e2456c92db3654c9785376dcfa.tar.gz
social-0fe574d93d3994e2456c92db3654c9785376dcfa.tar.bz2
social-0fe574d93d3994e2456c92db3654c9785376dcfa.zip
Fix recurrence logic for dayOfWeek and dayOfMonth
Change-Id: I8a5ab29ffb66135a417d6c5ad97185af9ec07ce9 Signed-off-by: hs321.lee <hs321.lee@samsung.com>
-rw-r--r--src/FScl_CalEventImpl.cpp38
1 files changed, 30 insertions, 8 deletions
diff --git a/src/FScl_CalEventImpl.cpp b/src/FScl_CalEventImpl.cpp
index cbb2c4b..6bd181b 100644
--- a/src/FScl_CalEventImpl.cpp
+++ b/src/FScl_CalEventImpl.cpp
@@ -967,11 +967,21 @@ _CalEventImpl::ConvertEventHandleToRecurrenceN(calendar_record_h eventHandle) co
}
else
{
- r = ConvertRRuleByDayStringToDayOfWeekAndWeekOfMonth(pByDay, weekOfMonth, dayOfWeek);
- SysTryReturn(NID_SCL, r == E_SUCCESS, null, E_INVALID_ARG, "[%s] Invalid argument is used. byday = %s", GetErrorMessage(E_INVALID_ARG), pByDay);
+ if(pByDay != null)
+ {
+ r = ConvertRRuleByDayStringToDayOfWeekAndWeekOfMonth(pByDay, weekOfMonth, dayOfWeek);
+ SysTryReturn(NID_SCL, r == E_SUCCESS, null, E_INVALID_ARG, "[%s] Invalid argument is used. byday = %s", GetErrorMessage(E_INVALID_ARG), pByDay);
+
+ pRecurrence->SetWeekOfMonth(weekOfMonth);
+ pRecurrence->SetDayOfWeek(dayOfWeek);
+ }
+ else
+ {
+ DateTime startTime = GetStartTime();
- pRecurrence->SetWeekOfMonth(weekOfMonth);
- pRecurrence->SetDayOfWeek(dayOfWeek);
+ dayOfMonth = startTime.GetDay();
+ pRecurrence->SetDayOfMonth(dayOfMonth);
+ }
}
break;
@@ -993,11 +1003,23 @@ _CalEventImpl::ConvertEventHandleToRecurrenceN(calendar_record_h eventHandle) co
}
else
{
- r = ConvertRRuleByDayStringToDayOfWeekAndWeekOfMonth(pByDay, weekOfMonth, dayOfWeek);
- SysTryReturn(NID_SCL, r == E_SUCCESS, null, E_INVALID_ARG, "[%s] Invalid argument is used. byday = %s", GetErrorMessage(E_INVALID_ARG), pByDay);
+ if(pByDay != null)
+ {
+ r = ConvertRRuleByDayStringToDayOfWeekAndWeekOfMonth(pByDay, weekOfMonth, dayOfWeek);
+ SysTryReturn(NID_SCL, r == E_SUCCESS, null, E_INVALID_ARG, "[%s] Invalid argument is used. byday = %s", GetErrorMessage(E_INVALID_ARG), pByDay);
- pRecurrence->SetWeekOfMonth(weekOfMonth);
- pRecurrence->SetDayOfWeek(dayOfWeek);
+ pRecurrence->SetWeekOfMonth(weekOfMonth);
+ pRecurrence->SetDayOfWeek(dayOfWeek);
+ }
+ else
+ {
+ DateTime startTime = GetStartTime();
+
+ dayOfMonth = startTime.GetDay();
+ monthOfYear = startTime.GetMonth();
+
+ pRecurrence->SetDayOfMonth(dayOfMonth);
+ }
}
pRecurrence->SetMonthOfYear(monthOfYear);