0

Im Used Angular-5 for my web application Im try to added Angular for Full Calendar event scheduler But cant be added correctly for this , I want to know how to added correctly add for angular attached link(Full Calendar Event Scheduler) please help me to fix this issue look at my attach image

My view index.component.html

 <div class="calendar">
    <angular2-fullcalendar [options]="calendarOptions" (initialized)="onCalendarInit($event)"></angular2-fullcalendar>
  </div>

index.component.ts

export class IndexComponent {


  calendarOptions: Object = {
    height: 'auto',

    defaultDate: '2017-12',
    editable: true,
    eventLimit: true, // allow "more" link when too many events
    navLinks: true,
    resourceAreaWidth: '15%',
    views: {
      timelineThreeDays: {
        type: 'timeline',
        duration: {
          days: 365
        }
      }
    },
    resourceGroupField: 'Rooms',
    resources: [{
      id: 'a',
      Rooms: ' Single Rooms (8)',
      title: 'Room # 1'
    }, {
      id: 'b',
      Rooms: ' Single Rooms (8)',
      title: 'Room # 2',
      eventColor: 'green'
    }, {
      id: 'c',
      Rooms: ' Single Rooms (8)',
      title: 'Room # 3',
      eventColor: 'orange'
    }, {
      id: 'd',
      Rooms: ' Single Rooms (8)',
      title: 'Room # 4',
      children: []
    }, {
      id: 'e',
      Rooms: ' Single Rooms (8)',
      title: 'Room # 5'
    }, {
      id: 'f',
      Rooms: ' Single Rooms (8)',
      title: 'Room # 6',
      eventColor: 'red'
    }, {
      id: 'g',
      Rooms: ' Single Rooms (8)',
      title: 'Room # 7',
      eventColor: 'orange'
    }, {
      id: 'h',
      Rooms: ' Single Rooms (8)',
      title: 'Room # 8',
      eventColor: 'green'
    }, {
      id: 'i',
      Rooms: ' Double Rooms (2)',
      title: 'Room # 9',
      eventColor: 'red'
    }, ],
    events: [


      {
        id: '1',
        resourceId: 'a',
        start: '2017-12-01',
        end: '2017-12-07',
        title: 'Mahesh'
      }, {
        id: '2',
        resourceId: 'b',
        start: '2017-12-12',
        end: '2017-12-15',
        title: 'Anushka'
      }, {
        id: '3',
        resourceId: 'c',
        start: '2017-12-11',
        end: '2017-12-15',
        title: 'Ramesh'
      }, {
        id: '4',
        resourceId: 'd',
        start: '2017-12-11',
        end: '2017-12-19',
        title: 'Susena'
      }, {
        id: '5',
        resourceId: 'e',
        start: '2017-12-15',
        end: '2017-12-28',
        title: 'Lahiru'
      }, {
        id: '6',
        resourceId: 'f',
        start: '2017-12-01',
        end: '2017-12-10',
        title: 'Chamath'
      }, {
        id: '7',
        resourceId: 'g',
        start: '2017-12-10',
        end: '2017-12-11',
        title: 'Channa'
      }, {
        id: '8',
        resourceId: 'h',
        start: '2017-12-09',
        end: '2017-12-14',
        title: 'Ganesh'
      }, {
        id: '9',
        resourceId: 'i',
        start: '2017-12-05',
        end: '2017-12-09',
        title: 'Priya'
      }
    ],
  }


  onCalendarInit(initialized: boolean) {
    console.log('Calendar initialized');
  }
}
core114
  • 5,155
  • 16
  • 92
  • 189
  • It's still in "month" view by the looks of it. I think you probably need to set the default view to your "timelineThreeDays" custom view. https://fullcalendar.io/docs/views/defaultView/ . If you want to allow the user to change between views then remember to set the header options as well: https://fullcalendar.io/docs/display/header/ – ADyson Dec 21 '17 at 10:26
  • @ADyson Sir any option is like https://fullcalendar.io/js/fullcalendar-scheduler-1.9.1/demos/simple.html calendar for Angular – core114 Dec 21 '17 at 10:34
  • What do you mean? The Angular part is largely irrelevant, you can set the same options in the calendar. Look at the source code of that demo page to see how they set it up. The only slight difference when you use angular is that you declare calendarOptions as a separate variable. What you put _inside_ that is the same as when you use raw fullCalendar. – ADyson Dec 21 '17 at 10:35
  • cant do that, Look at my code , Im try to do that its not display – core114 Dec 21 '17 at 10:36
  • The options given in your code are not the same as the demo code. Did you actually look at it? – ADyson Dec 21 '17 at 10:37
  • Also, you do understand that Scheduler is an extra part of fullCalendar, don't you? So you have to download it separately. I don't know if there is a package for it in angular or not. – ADyson Dec 21 '17 at 10:39
  • Sir Im all ready added for my Html project,look my another question https://stackoverflow.com/questions/47766230/full-calendar-scheduler-to-cant-added-separate-rooms, its working fine, But I want t o know how to implantation for this calendar https://fullcalendar.io/js/fullcalendar-scheduler-1.9.1/demos/simple.html Angular – core114 Dec 21 '17 at 10:43
  • Im added demo code but not work – core114 Dec 21 '17 at 10:43
  • "not work" could mean anything, that's a useless piece of information. Did you get a console error? Anyway...don't add the demo code _literally_, obviously that's not how you it in angular, as you know. Refer to my earlier comments about using the calendar _options_ code only. Pay closer attention to what is said please. As for your earlier question, that appears to be a totally different codebase, which does not use the AngularJS style. So just because you included scheduler in that version bears no relation to this version. There's no evidence of scheduler being present in your code above. – ADyson Dec 21 '17 at 13:43
  • Do you really need to use Angular? It seems to be causing more problems than it's solving. – ADyson Dec 21 '17 at 13:45
  • @ADyson Yeah I need that one, because my project base Angular 5 – core114 Dec 22 '17 at 04:00
  • @ADyson I follow some article, its can be add but its Sheduler is premium version https://fullcalendar.io/scheduler/download/ , – core114 Dec 22 '17 at 04:03
  • @ADyson any idea for this question https://stackoverflow.com/questions/47924268/angular-full-calendar-for-add-ng-bootstrap-modal-popup-issue – core114 Dec 22 '17 at 04:07
  • Scheduler is premium, but if the organisation who will be using the application is a non-profit, or your application is completely open-source, then you are permitted to use it for free. See https://fullcalendar.io/scheduler/license/ . I'm afraid I don't know anything much about angular at all, so I can't advise you on your other question, it seems largely unrelated to fullCalendar, and is more about integrating angular and bootstrap. – ADyson Dec 22 '17 at 14:49
  • Sir, Im used for my university project, – core114 Dec 25 '17 at 11:54
  • In that case you can see clearly from that link that you can use it freely. – ADyson Dec 27 '17 at 20:14

0 Answers0