neuronetio / gantt-elastic

Gantt Chart [ javascript gantt chart, gantt component, vue gantt, vue gantt chart, responsive gantt, project manager , vue projects ]

Home Page:https://neuronet.io/gantt-elastic/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

error while disabling Hour

mdieudonne opened this issue · comments

Hi, thanks for the great job.
This is the first time I open an issue. I'll just get to the point:

I keep having an error when I try to disable 'hour' in the Calendar options:
ReferenceError: "userOptions is not defined"

calendar: { gap: 6, height: 0, hour: { height: 20, display: false, format: { long (date) { return dayjs(date) .locale(userOptions.locale.code) .format("HH:mm"); }, medium (date) { return dayjs(date) .locale(userOptions.locale.code) .format("HH:mm"); }, short (date) { return dayjs(date) .locale(userOptions.locale.code) .format("HH"); } } }, day: { height: 20, display: true, format: { long (date) { return dayjs(date) .locale(userOptions.locale.code) .format("DD dddd"); }, medium (date) { return dayjs(date) .locale(userOptions.locale.code) .format("DD ddd"); }, short (date) { return dayjs(date) .locale(userOptions.locale.code) .format("DD"); } } }, month: { height: 20, display: true, format: { short (date) { return dayjs(date) .locale(userOptions.locale.code) .format("MM"); }, medium (date) { return dayjs(date) .locale(userOptions.locale.code) .format("'YY MMM"); }, long (date) { return dayjs(date) .locale(userOptions.locale.code) .format("YYYY MMMM (MM)"); } } } },

Shouldn't 'userOptions.locale.code' be 'options.locale.code' ?
no more error thrown, but not the expected behavior: see as below.

display: True:
image

display: False:
image

EDIT: with option as below : ( format("") )
I get rid of the hours
hour: { height: 20, display: false, format: { long(date) { return dayjs(date).locale(options.locale.code).format(""); }, medium(date) { return dayjs(date).locale(options.locale.code).format(""); }, short(date) { return dayjs(date).locale(options.locale.code).format(""); } } },

image

That is a bug.
I've didn't test that option for a long time.
I will check it!
Thanks for report!

Is that me or display hours: false isn't working as expected in the last version 0.9.1?

image

Thx

I will check it later, code of calendar rows height has changed so most probably its gantt fault👎

fixed in 0.9.2