import { NgModule, LOCALE_ID, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';

import { IonicModule } from '@ionic/angular';

import { AgendaPageRoutingModule } from './agenda-routing.module';

import { AgendaPage } from './agenda.page';
import { NgCalendarModule } from 'ionic2-calendar';

import { registerLocaleData } from '@angular/common';
import localeDe from '@angular/common/locales/pt';

registerLocaleData(localeDe);

import { CalendarModule, DateAdapter } from 'angular-calendar';
import { adapterFactory } from 'angular-calendar/date-adapters/date-fns';
import { EventsToApprovePage } from 'src/app/shared/gabinete-digital/events-to-approve/events-to-approve.page';



import { AttendeeModalPageModule } from 'src/app/shared/event/attendee-modal/attendee-modal.module';
import { HeaderPageModule } from 'src/app/shared/header/header.module';
import { ViewEventPageModule } from 'src/app/shared/agenda/view-event/view-event.module';
import { ApproveEventPageModule } from 'src/app/shared/agenda/approve-event/approve-event.module';
import { NewEventPageModule } from 'src/app/shared/agenda/new-event/new-event.module';


import { EventsToApprovePageModule } from 'src/app/shared/gabinete-digital/events-to-approve/events-to-approve.module';
import { EventListPageModule } from 'src/app/shared/agenda/event-list/event-list.module';
import { EditEventPageModule } from 'src/app/shared/agenda/edit-event/edit-event.module';
import { EditEventToApprovePageModule } from 'src/app/shared/agenda/edit-event-to-approve/edit-event-to-approve.module';

@NgModule({
  imports: [
    CommonModule,
    FormsModule,
    IonicModule,
    /*  */
    CalendarModule.forRoot({
      provide: DateAdapter,
      useFactory: adapterFactory
    }),

    AgendaPageRoutingModule,
    NgCalendarModule,
    // entryComponents
    HeaderPageModule,
    ViewEventPageModule,
    AttendeeModalPageModule,
    EventsToApprovePageModule,
    ApproveEventPageModule,
    NewEventPageModule,
    EventListPageModule,
    EditEventPageModule,
    EditEventToApprovePageModule,
  ],
  declarations: [
    AgendaPage
  ],
  schemas: [CUSTOM_ELEMENTS_SCHEMA],
  providers: [
    { provide: LOCALE_ID, useValue: 'pt-PT'}
  ]
})
export class AgendaPageModule {}
