twinssbc / Ionic2-Calendar

A calendar component based on Ionic framework
https://ionic-calendar-demo.stackblitz.io
MIT License
388 stars 197 forks source link

EXCEPTION: Error in ./CalendarComponent class CalendarComponent - inline template:39:16 caused by: Cannot read property 'getFullYear' of undefined #70

Closed christiams closed 7 years ago

christiams commented 7 years ago

Hello! I'm trying to run ionic serve and have this problem:

EXCEPTION: Error in ./CalendarComponent class CalendarComponent - inline template:39:16 caused by: Cannot read property 'getFullYear' of undefined

I try to import import explicitly below lines in main.prod.ts

import { CalendarComponent } from 'ionic2-calendar/calendar';
import { MonthViewComponent } from 'ionic2-calendar/monthview';
import { WeekViewComponent } from 'ionic2-calendar/weekview';
import { DayViewComponent } from 'ionic2-calendar/dayview';

Cordova CLI: 6.5.0 Ionic Framework Version: 2.1.0 Ionic CLI Version: 2.2.1 Ionic App Lib Version: 2.2.0 Ionic App Scripts Version: 1.1.3 ios-deploy version: 1.8.6 ios-sim version: 4.1.1 OS: OS X El Capitan Node Version: v7.2.0 Xcode version: Xcode 8.2.1 Build version 8C1002

But same error. Can you help? Thanks

christiams commented 7 years ago

I solved

ChrisProlls commented 7 years ago

Please post your solution @christiams I have the same problem.

christiams commented 7 years ago

My solution was copy paste all the functions from controller. In first instance i copied only some

ChrisProlls commented 7 years ago

Thanks. My solution was to affect the current date property.

<calendar [currentDate]="currentDate">
</calendar>