CroudTech / vue-fullcalendar

FullCalendar Wrapper for vue
MIT License
483 stars 100 forks source link

"undefined" next to dates #98

Closed milostimotic closed 6 years ago

milostimotic commented 6 years ago

I am using vue-fullcalendar 2.5.1 together with Scheduler 1.9.1. As soon as Scheduler add-on is imported, the "undefined" text is appear next to all dates in the calendar. I searched for this issue and one of the suggestions was to include moment.js before fullcalendar. Tried this but it doesn't solve the issue.

Selection_002

I am not sure how can I provide an example but this how I implemented it:


<template>

          <full-calendar
              ref="calendar"
              :events="events"
              :config="config"
              @event-selected="eventSelected"
              @event-render="eventRender"
          >
          </full-calendar>

</template>

<script>

  import * as moment from 'moment'

  import { FullCalendar } from 'vue-full-calendar'
  import "fullcalendar/dist/fullcalendar.min.css"
  import "fullcalendar-scheduler"
  import "fullcalendar-scheduler/dist/scheduler.min.css"

  export default {

    data () {
      return {

      }
    },

    components: {
      FullCalendar
    }
  }
</script>
BrockReece commented 6 years ago

Hi, have you seen this example codesandbox?

milostimotic commented 6 years ago

Hi BrockReece,

Thank you for reply. Yes, I saw your example and I was working based on it. When I copy your example to my project I also get "undefined" values next to every date or time. Also I have added all same dependencies like in your example but without luck. As soon I remove this line import "fullcalendar-scheduler" the problems disappear. I tried to reproduce it on codesandbox but I couldn't.

BrockReece commented 6 years ago

I'm not sure then sorry. I am guessing there may be something else in your project that could be affecting this. Maybe If I knew a bit more about your project I could try to reproduce your issue?

milostimotic commented 6 years ago

I'will try to debug this and will let you know when I find solution.

milostimotic commented 6 years ago

Hi again,

I managed to find out why is this happening. When execute: npm install fullcalendar-schedule npm add node-modules inside fullcalendar-schedule and inside it is one more fullcalendar. So it seems that there are 2 fullcalendars in the project. When I manually delete fullcalendar from fullcalendar-schedule everything works fine.

Also I have to use fullcalendar-schedule version 1.9, because this workaround is not working with version 1.9.1. Do you know maybe why is this happening?

Also it seems that your sandbox are not working longer. Probably some issues with codesandbox.

BrockReece commented 6 years ago

Thanks for the heads up on the codesandbox, I think I have fixed them now.

As for the duplicated versions of fullcalendar, it looks like fullcalendar-schedule depends on a specific minor version of fullcalendar, if your pre existing version of fullcalendar does not match this, npm will nest the required version inside of the fullcalendar-schedule's node_modules dir.

As you can see here, it depends on fullcalendar ~3.8.x

I hope that helps?

MrMitch commented 5 years ago

I was having the same issue, as explained in fullcalendar/fullcalendar#3911 (comment), I solved it by feeding the non-minified version of fullcalendar to webpack instead of the minified one.

PhilMDev commented 5 years ago

This is caused by scheduler loading it's own version of fullcalendar. The best solution that I've found is to edit the package.json for fullcalendar-scheduler and remove the dependency for fullcalendar. You also have to delete the fullcalendar directory you'll find in node-modules for fullcalendar-scheduler. Also, that's where the package.json file is located that needs to be edited. Unfortunately, if you reinstall or update you will probably have to make the same change.

I have been in contact with @Dylan Ferris (the developer of fullcalendar) here on GitHub. He does have a newer package.json file that doesn't have the dependency. However, when you install from npm you still get the old file. Not sure why. And he hasn't been able to add anything.

But, I can assure you, this will solve the problem.