From d2e23f8d2a05f852c832e27fbba977712401fd9b Mon Sep 17 00:00:00 2001 From: Stephen James Date: Mon, 28 Dec 2015 16:43:23 -0500 Subject: [PATCH] Merge PR #1627 'weekly' into refactor --- js/scheduler.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/js/scheduler.js b/js/scheduler.js index 6be5605f7..343194362 100644 --- a/js/scheduler.js +++ b/js/scheduler.js @@ -492,16 +492,20 @@ } else if (recur.FREQ === 'HOURLY') { item = 'hourly'; } else if (recur.FREQ === 'WEEKLY') { + item = 'weekly'; + if (recur.BYDAY) { - item = this.$element.find('.repeat-days-of-the-week .btn-group'); - item.find('label').removeClass('active'); - commaSplitPattern = recur.BYDAY.split(','); - for (i = 0, commaSplitPattern.length; i < commaSplitPattern.length; i++) { - item.find('input[data-value="' + commaSplitPattern[i] + '"]').prop('checked',true).parent().addClass('active'); + if (recur.BYDAY === 'MO,TU,WE,TH,FR') { + item = 'weekdays'; + } else { + var el = this.$element.find('.repeat-days-of-the-week .btn-group'); + el.find('label').removeClass('active'); + commaSplitPattern = recur.BYDAY.split(','); + for (i = 0; i < commaSplitPattern.length; i++) { + el.find('input[data-value="' + commaSplitPattern[i] + '"]').prop('checked',true).parent().addClass('active'); + } } } - - item = 'weekly'; } else if (recur.FREQ === 'MONTHLY') { this.$element.find('.repeat-monthly input').removeAttr('checked').removeClass('checked'); this.$element.find('.repeat-monthly label.radio-custom').removeClass('checked');