angular-ui / ui-calendar

A complete AngularJS directive for the Arshaw FullCalendar.
http://angular-ui.github.io/ui-calendar/
MIT License
1.49k stars 729 forks source link

Event disappear after switching months and after hitting today #547

Open Hasan-Mainul opened 3 years ago

Hasan-Mainul commented 3 years ago

$scope.getAllTimelineByPOID = function (PurchaseOrderID) { timelineService.getAllTimelineByPOID(PurchaseOrderID).then(function (res) { if (res.data.length > 0) { $scope.timelineList = formatDate(res.data, '', ["PlannedDate", 'ActualDate', 'LastModified']);
var calenderval = res.data;
angular.forEach(calenderval, /stick,/ function (value) {
$scope.events.push({ title: value.Description, start: value.ActualDate //Cache: true //stick: true //end: value.ActualDate, //allDay: false

                });
            });
            $scope.eventSources = [$scope.events];
            console.log($scope.eventSources);

            for (var i = 0; i < $scope.timelineList.length; i++) {
                $scope.timelineList[i].ActualDate = new Date($scope.timelineList[i].ActualDate);
                $scope.timelineList[i].LastModified = new Date($scope.timelineList[i].LastModified);
            }
        }
        else {
            $scope.timelineList.push($scope.timeline);
        }
    });
};