Home Fullcalendar, i would like to Create an event every 12 weeks on a Friday, until a specific date
Reply: 0

Fullcalendar, i would like to Create an event every 12 weeks on a Friday, until a specific date

user2206
1#
user2206 Published in April 22, 2018, 10:09 pm

I develop an application with an API in CakePhp 3 and the front in AngularJS. I integrate Fullcalendar and I would like to Create, for example : an event every 12 weeks on a Friday, until a specific date like google calendar.

here is the code for get event :

calendarService.getTurnsInfo()
    .then(function(response) {

        if (response.data.errors)
            $scope.errors.event = response.data.errors;
        else {
            $scope.events.data   = response.data.event;
            console.log($scope.events.data);
        angular.forEach($scope.events.data, function (value, key){
            console.log(value);
            console.log(value.turn_schedules[0].start_at);
            $scope.event.push(

            {    title: value.name,
                 start: moment(value.turn_schedules[0].start_at ? $filter('date')(value.turn_schedules[0].start_at) : new Date()).format('YYYY-MM-DD'),
                 end: moment(value.turn_schedules[0].end_at ? $filter('date')(value.turn_schedules[0].end_at) : new Date()).format('YYYY-MM-DD'),
                 color: 'Blue',
                 allDay: true,
                 stick: true
            }
          );

        });
            console.log($scope.event);
        }
        if (response.data.redirect)
            $scope.Admins.loggedIn = false;
    },function (error) {
        $scope.errors['general'] = gettextCatalog.getString('Une erreur est survenue, merci de réessayer');
        $scope.event.success = false;
    });


    /* config object */
    $scope.uiConfig = {
     calendar:{
        height: 450,
        editable: true,
        locale: 'fr',
        lang: 'fr',
        header:{
            left: 'month basicWeek basicDay agendaWeek agendaDay',
            center: 'title prevYear nextYear',
            right: 'today prev,next'
        },
        eventClick: $scope.alertOnEventClick,
        eventDrop: $scope.alertOnDrop,
        eventResize: $scope.alertOnResize,
        eventRender: $scope.eventRender,
        dayClick:$scope.alertOnEventClick
    }
};

 $scope.eventSources = [$scope.event, $scope.calEventsExt,$scope.eventsF];

Thanks for help

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.300906 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO