issue with angular 6 calender
See original GitHub issueDescribe the bug
core.js:15713 ERROR TypeError: dateAdapter.startOfWeek is not a function at getWeekViewHeader (calendar-utils.js:174) at CalendarUtils.push…/node_modules/angular-calendar/fesm5/angular-calendar.js.CalendarUtils.getWeekViewHeader (angular-calendar.js:1145) at CalendarMonthViewComponent.push…/node_modules/angular-calendar/fesm5/angular-calendar.js.CalendarMonthViewComponent.refreshHeader (angular-calendar.js:1854) at CalendarMonthViewComponent.push…/node_modules/angular-calendar/fesm5/angular-calendar.js.CalendarMonthViewComponent.ngOnChanges (angular-calendar.js:1744) at checkAndUpdateDirectiveInline (core.js:21996) at checkAndUpdateNodeInline (core.js:23264) at checkAndUpdateNode (core.js:23226) at prodCheckAndUpdateNode (core.js:23767) at Object.eval [as updateDirectives] (CalendarComponent.ngfactory.js:185) at Object.updateDirectives (core.js:23555) defaultErrorLogger @ core.js:15713 push…/node_modules/@angular/core/fesm5/core.js.ErrorHandler.handleError @ core.js:15761 (anonymous) @ core.js:18027 push…/node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke @ zone.js:391 push…/node_modules/zone.js/dist/zone.js.Zone.run @ zone.js:150 push…/node_modules/@angular/core/fesm5/core.js.NgZone.runOutsideAngular @ core.js:17247 push…/node_modules/@angular/core/fesm5/core.js.ApplicationRef.tick @ core.js:18027 (anonymous) @ core.js:17911 push…/node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke @ zone.js:391 onInvoke @ core.js:17288 push…/node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke @ zone.js:390 push…/node_modules/zone.js/dist/zone.js.Zone.run @ zone.js:150 push…/node_modules/@angular/core/fesm5/core.js.NgZone.run @ core.js:17202 next @ core.js:17911 schedulerFn @ core.js:13504 push…/node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.__tryOrUnsub @ Subscriber.js:194 push…/node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.next @ Subscriber.js:132 push…/node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber._next @ Subscriber.js:76 push…/node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next @ Subscriber.js:53 push…/node_modules/rxjs/_esm5/internal/Subject.js.Subject.next @ Subject.js:47 push…/node_modules/@angular/core/fesm5/core.js.EventEmitter.emit @ core.js:13488 checkStable @ core.js:17257 onHasTask @ core.js:17301 push…/node_modules/zone.js/dist/zone.js.ZoneDelegate.hasTask @ zone.js:443 push…/node_modules/zone.js/dist/zone.js.ZoneDelegate._updateTaskCount @ zone.js:463 push…/node_modules/zone.js/dist/zone.js.Zone._updateTaskCount @ zone.js:291 push…/node_modules/zone.js/dist/zone.js.Zone.runTask @ zone.js:212 drainMicroTaskQueue @ zone.js:601 Promise resolved (async) scheduleMicroTask @ zone.js:584 push…/node_modules/zone.js/dist/zone.js.ZoneDelegate.scheduleTask @ zone.js:413 push…/node_modules/zone.js/dist/zone.js.Zone.scheduleTask @ zone.js:238 push…/node_modules/zone.js/dist/zone.js.Zone.scheduleMicroTask @ zone.js:258 scheduleResolveOrReject @ zone.js:879 ZoneAwarePromise.then @ zone.js:1012 push…/node_modules/@angular/core/fesm5/core.js.PlatformRef.bootstrapModule @ core.js:17792 ./src/main.ts @ main.ts:18 webpack_require @ bootstrap:78 0 @ main.ts:19 webpack_require @ bootstrap:78 checkDeferredModules @ bootstrap:45 webpackJsonpCallback @ bootstrap:32 (anonymous) @ main.js:1 core.js:15713 ERROR TypeError: Cannot read property ‘rowOffsets’ of undefined at Object.eval [as updateDirectives] (CalendarMonthViewComponent.ngfactory.js:140) at Object.updateDirectives (core.js:23555) at checkAndUpdateView (core.js:23208) at callViewAction (core.js:23449) at execComponentViewsAction (core.js:23391) at checkAndUpdateView (core.js:23214) at callViewAction (core.js:23449) at execEmbeddedViewsAction (core.js:23412) at checkAndUpdateView (core.js:23209) at callViewAction (core.js:23449)
Minimal reproduction of the problem with instructions
Screenshots
Versions
@angular/core
: “^7.2.4”,angular-calendar
: “^0.26.6”- Browser name and version: chrome
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
Yup, it’s because the angular-calendar DateAdapter has the same class name as the global material DateAdapter so if they are in the same module and you provide MaterialDateAdapter for the DateAdapter the angular-calendar uses that instead of adapterFactory. So the angular-calendar has to be declared in a submodule of the main module, so that the global material DateAdapter can be overridden in the app’s main module and the angular-calendar DateAdapter can be provided by adapterFactory in its own submodule.
Sorry, from the information that you posted I can’t tell what the issue is, please file a new issue with a minimal repro that I can run that demonstrates your problem. Thanks! 😄