diff --git a/UI/Scheduler/UIxComponentEditor.m b/UI/Scheduler/UIxComponentEditor.m
index 1d46dec7b..1521b06d9 100644
--- a/UI/Scheduler/UIxComponentEditor.m
+++ b/UI/Scheduler/UIxComponentEditor.m
@@ -82,7 +82,7 @@ iRANGE(2);
#define REPEAT(X) \
- (NSString *) repeat##X { return repeat##X; } \
-- (void) setRepeat##X: (NSString *) theValue { NSLog(@"setRepeat %@", theValue); ASSIGN(repeat##X, theValue); } \
+- (void) setRepeat##X: (NSString *) theValue { NSLog(@"setRepeat%d %@", X, theValue); ASSIGN(repeat##X, theValue); } \
#define RANGE(X) \
- (NSString *) range##X { return range##X; } \
diff --git a/UI/Templates/SchedulerUI/UIxRecurrenceEditor.wox b/UI/Templates/SchedulerUI/UIxRecurrenceEditor.wox
index b246c9687..a9764a1bf 100644
--- a/UI/Templates/SchedulerUI/UIxRecurrenceEditor.wox
+++ b/UI/Templates/SchedulerUI/UIxRecurrenceEditor.wox
@@ -60,14 +60,14 @@
|
diff --git a/UI/WebServerResources/UIxRecurrenceEditor.js b/UI/WebServerResources/UIxRecurrenceEditor.js
index b23c30cae..104ff186f 100644
--- a/UI/WebServerResources/UIxRecurrenceEditor.js
+++ b/UI/WebServerResources/UIxRecurrenceEditor.js
@@ -93,11 +93,17 @@ function initializeFormValues() {
else if (repeatType == 1) {
// Repeat weekly
$('weeklyWeeksField').value = parent$("repeat1").value;
- var weekDiv = $("week").firstChild;
- var daysArray = parent$("repeat2").value.split(",");
- daysArray.each(function(index) {
- $(weekDiv).down('div', index).addClassName("_selected");
+ var weekDiv = $($("week").firstChild);
+ log ("div: " + weekDiv);
+ log ("days: " + parent$("repeat2").value);
+ var days = "" + parent$("repeat2").value;
+ if (days.length > 0) {
+ var daysArray = days.split(",");
+ var divs = weekDiv.childNodesWithTag("div");
+ daysArray.each(function(index) {
+ divs[index-1].addClassName("_selected");
});
+ }
}
else if (repeatType == 2) {
// Repeat monthly
@@ -106,10 +112,13 @@ function initializeFormValues() {
$('monthlyRepeat').value = parent$("repeat3").value;
$('monthlyDay').value = parent$("repeat4").value;
var monthDiv = $("month");
- var daysArray = parent$("repeat5").value.split(",");
- daysArray.each(function(index) {
- $(monthDiv).down('DIV[name="'+index+'"]').addClassName("_selected");
- });
+ var days = "" + parent$("repeat5").value;
+ if (days.length > 0) {
+ var daysArray = days.split(",");
+ daysArray.each(function(index) {
+ $(monthDiv).down('DIV[name="'+index+'"]').addClassName("_selected");
+ });
+ }
}
else if (repeatType == 3) {
// Repeat yearly