zunnzunn / vue-ganttastic

Simple, interactive and highly customizable Gantt chart component for Vue 3
https://zunnzunn.github.io/vue-ganttastic/
565 stars 141 forks source link

e.add(...).isSameOrAfter is not a function #78

Open rsoltanzadeh opened 1 year ago

rsoltanzadeh commented 1 year ago

Uncaught (in promise) TypeError: e.add(...).isSameOrAfter is not a function

I've been struggling for weeks with this error. Can't figure out what's causing it. It worked fine before I migrated from barebones Vue 3 to Nuxt 3, but I don't see how that changes anything.

Thankful for any assistance.

rsoltanzadeh commented 1 year ago

I noticed this happens only when chart-start and chart-end differ, regardless of whether I use Date objects or string representations.

Same dates:

image

Different dates:

image

image

Adesin-fr commented 12 months ago

I am facing this too...

Such a pity this lib seems not maintained anymore, it was very promising !

Edit : Found out this error was because moment.js package was not imported into my project !

Trolldemorted commented 8 months ago

Edit : Found out this error was because moment.js package was not imported into my project !

manually adding a dep to moment.js solved this for you?

Adesin-fr commented 8 months ago

As far as I can remember, I think so... It's been a while ;)

fabianpnke commented 7 months ago

Hi, I solved the problem by importing day js together with the plugin in the file that is using the Gantt components.

import dayjs from "dayjs"
import isSameOrAfter from "dayjs/plugin/isSameOrAfter.js"
dayjs.extend(isSameOrAfter)