-
-
Notifications
You must be signed in to change notification settings - Fork 48
/
task-calendar.component.ts
37 lines (31 loc) · 1.21 KB
/
task-calendar.component.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { Component, OnInit } from '@angular/core';
import { GlobalService } from 'src/app/framework/services/global.service';
import { Router, ActivatedRoute } from '@angular/router';
import { TaskService } from 'src/app/framework/services/task.service';
import dayGridPlugin from '@fullcalendar/daygrid';
import timeGridPlugin from '@fullcalendar/timegrid';
import interactionPlugin from '@fullcalendar/interaction';
@Component({
selector: 'app-task-calendar',
templateUrl: './task-calendar.component.html',
styleUrls: ['./task-calendar.component.css']
})
export class TaskCalendarComponent implements OnInit {
events: any[];
options: any;
constructor(private service: TaskService, private global: GlobalService, private router: Router, private route: ActivatedRoute) { }
ngOnInit() {
this.service.getAllTaskCalendar().subscribe(data => this.events = data.events);
this.options = {
plugins: [dayGridPlugin, timeGridPlugin, interactionPlugin],
defaultDate: Date.now(),
header: {
left: 'prev,next,month,agendaWeek,agendaDay',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
editable: true,
dateClick: (e) => { console.log(e); }
};
}
}