0

Problems in upgrading to 4.0.1.

documentation says: "for registering a custom view use createPlugin instead of defineView"

but seems like this info is out of date also:

QUESTION: So what is exact code rows in v.4.0.1 to replace my old: "defineView" code?

I tried to do as said in: https://fullcalendar.io/docs/upgrading-from-v3

My old code:

import { defineView } from "fullcalendar";
defineView("reosurces", {
   "class": OwnView,
   defaults: {
     duration: "00:15:00",
   }
});

as with example:


import { createPlugin } from '@fullcalendar/core';
export default createPlugin({
  views: {
    specialView: {
      type: 'theViewType',
      slotLabalInterval: '06:00' // top-level property!
    },
    customView: CustomViewClass // can pass-in the class directly!
  }
})
ADyson
  • 57,178
  • 14
  • 51
  • 63
DJV
  • 21
  • 4
  • does something go wrong when you run each of these pieces of code? if so, what is it, exactly? Is there an error message? Or surprising behaviour? Please clarify. – ADyson Mar 27 '19 at 22:36
  • BTW `slotLabalInterval` looks like a typo. Probably should be `slotLabelInterval` – ADyson Mar 27 '19 at 22:37
  • Hi. Problem is they on 4.0.1 both of upper one are 'deprecated' and will not work anymore – DJV Mar 28 '19 at 08:26
  • There is another sample code on the actual documentation page: https://fullcalendar.io/docs/custom-view-with-js . Have you tried that? – ADyson Mar 28 '19 at 09:31
  • Hi. This: export default createPlugin({ views: { custom: CustomView } }); cause error: Argument of type '{ views: { custom: any; }; }' is not assignable to parameter of type 'PluginDefInput'. Object literal may only specify known properties, and 'views' does not exist in type 'PluginDefInput'. – DJV Mar 29 '19 at 08:57
  • Ok. Maybe you should raise a bug / issue about this on the fullCalendar GitHub. It seems maybe there's some inaccuracy in the documentation, and/or an issue in the code. v4 was only released a few days ago so I guess there might be some teething problems. See https://fullcalendar.io/reporting-bugs for details. P.S. In your example above where you got that error, did you create the class as well, as shown in the example? – ADyson Mar 29 '19 at 09:30
  • Yeh. error is given even with pure example. 'PluginDefInput' parameter seems rise error – DJV Mar 29 '19 at 10:54

0 Answers0