diff --git a/widget/assets/js/rrule.js b/widget/assets/js/rrule.js index b75e991..a5a0ea9 100644 --- a/widget/assets/js/rrule.js +++ b/widget/assets/js/rrule.js @@ -1884,7 +1884,8 @@ rrule._iter(iterResult) }) - var res = iterResult._result + // Filtering excluded and deleted dates to get the final updated events result + var res = iterResult._result.filter(date => !this._exdate.find(exdate => new Date(exdate).setHours(0,0,0) === new Date(date).setHours(0,0,0))) dateutil.sort(res) switch (iterResult.method) { case 'all': diff --git a/widget/controllers/widget.feed.controller.js b/widget/controllers/widget.feed.controller.js index 0536f66..aac993f 100644 --- a/widget/controllers/widget.feed.controller.js +++ b/widget/controllers/widget.feed.controller.js @@ -285,7 +285,6 @@ temp_result.tmpStartDate = temp_result.startDate; temp_result.startDate = Date.parse(dates[j]); temp_result.endDate = temp_result.startDate + eventDuration; - temp_result.UID = temp_result.UID + String(temp_result.startDate) + String(temp_result.endDate) if (temp_result.startDate >= +new Date(eventStartDate) && temp_result.startDate <= +new Date(eventRecEndDate)) if (AllEvent) repeat_results.push(temp_result); @@ -314,13 +313,15 @@ startDate += 86400000; while (startDate < endDate) { if (startDate >= +new Date(eventStartDate) && startDate <= +new Date(eventRecEndDate) && (AllEvent || startDate >= timeStampInMiliSec)) { - repeat_results.push({...result.events[i], startDate: new Date(startDate), UID: "_id" + Date.now() + Math.random()}); + repeat_results.push({...result.events[i], startDate: new Date(startDate)}); } startDate += 86400000; } } }} + // filter out the repeating events that have been updated + repeat_results = utils.filterUpdatedEvents(repeat_results); //sort the list by start date repeat_results.sort(function (a, b) { if (a.startDate > b.startDate) { diff --git a/widget/index.html b/widget/index.html index 731d0c2..5f23bc9 100644 --- a/widget/index.html +++ b/widget/index.html @@ -25,6 +25,8 @@ + + @@ -68,7 +70,7 @@ ng-swipe-left="WidgetFeed.addEvents($event, $index, false)" custom-class="getDayClass(date, mode)" ng-class="{'active' : WidgetFeed.swiped[$index]}" - ng-repeat="event in WidgetFeed.events track by event.UID"> + ng-repeat="event in WidgetFeed.events track by event.id">