import { Injectable } from '@angular/core'; import { OptionsInput } from '@fullcalendar/core'; import dayGridPlugin from '@fullcalendar/daygrid'; import timeGrigPlugin from '@fullcalendar/timegrid'; import interactionPlugin from '@fullcalendar/interaction'; import {CalendarLocaleService} from './calendar.locale.service'; @Injectable({ providedIn: 'root' }) export class DefaultConfigService { constructor(private localeService: CalendarLocaleService) {} private defaultConfig: OptionsInput = { header: { left: 'prevYear,prev,next,nextYear today', center: 'title', right: 'dayGridMonth,timeGridWeek,timeGridDay,listWeek' }, navLinks: true, // can click day/week names to navigate views editable: true, selectable: true, defaultView: 'dayGridMonth', eventLimit: true, // allow "more" link when too many events plugins: [dayGridPlugin, timeGrigPlugin, interactionPlugin] }; public getDefaultConfig() { return Object.assign(this.defaultConfig, this.localeService.getLocaleConfig()); // return this.defaultConfig; } }