← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

[Merge] lp:~pkunal-parmar/ubuntu-calendar-app/Monthly-YearlyEvent into lp:ubuntu-calendar-app

 

Kunal Parmar has proposed merging lp:~pkunal-parmar/ubuntu-calendar-app/Monthly-YearlyEvent into lp:ubuntu-calendar-app.

Commit message:
resolves https://bugs.launchpad.net/ubuntu-calendar-app/+bug/1438910

Requested reviews:
  Ubuntu Calendar Developers (ubuntu-calendar-dev)

For more details, see:
https://code.launchpad.net/~pkunal-parmar/ubuntu-calendar-app/Monthly-YearlyEvent/+merge/255919

Resolves bug 1438910
https://bugs.launchpad.net/ubuntu-calendar-app/+bug/1438910
-- 
Your team Ubuntu Calendar Developers is requested to review the proposed merge of lp:~pkunal-parmar/ubuntu-calendar-app/Monthly-YearlyEvent into lp:ubuntu-calendar-app.
=== modified file 'EventRepetition.qml'
--- EventRepetition.qml	2014-10-22 14:03:01 +0000
+++ EventRepetition.qml	2015-04-12 04:54:04 +0000
@@ -90,7 +90,7 @@
 
             }
         }
-           recurrenceOption.selectedIndex = index;
+        recurrenceOption.selectedIndex = index;
     }
 
     head.backAction: Action{
@@ -100,20 +100,36 @@
             var recurrenceRule = Defines.recurrenceValue[ recurrenceOption.selectedIndex ];
             if (recurrenceRule !== RecurrenceRule.Invalid) {
                 rule.frequency = recurrenceRule;
-                if (recurrenceOption.selectedIndex > 0) {
-                    rule.daysOfWeek = eventUtils.getDaysOfWeek(recurrenceOption.selectedIndex,weekDays );
-                    if (limitOptions.selectedIndex === 1
-                            && recurrenceOption.selectedIndex > 0
-                            && limitCount.text != "") {
-                        rule.limit =  parseInt(limitCount.text);
-                    }
-                    else if (limitOptions.selectedIndex === 2 && recurrenceOption.selectedIndex > 0) {
-                        rule.limit =  datePick.date;
-                    }
-                    else {
-                        rule.limit = undefined;
-                    }
-                }
+                if( recurrenceOption.selectedIndex < 5 )
+                {
+                    //If it is daily or weekly or alternate days10+
+                    rule.daysOfWeek = eventUtils.getDaysOfWeek(recurrenceOption.selectedIndex, weekDays );
+                } else {
+                    //Monthly or Yearly
+                    switch(recurrenceOption.selectedIndex){
+                    case 6: //monthly
+                        rule.daysOfMonth = [date.getDate()];
+                        break;
+                    case 7: //yearly
+                        rule.monthsOfYear = [date.getMonth()];
+                        rule.daysOfMonth = [date.getDate()];
+                        break;
+                    default:
+                    }
+                }
+
+                if (limitOptions.selectedIndex === 1
+                        && recurrenceOption.selectedIndex > 0
+                        && limitCount.text != "") {
+                    rule.limit =  parseInt(limitCount.text);
+                }
+                else if (limitOptions.selectedIndex === 2 && recurrenceOption.selectedIndex > 0) {
+                    rule.limit =  datePick.date;
+                }
+                else {
+                    rule.limit = undefined;
+                }
+
             }
             else {
                 rule.frequency = 0


Follow ups