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.
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(""); } } },
That is a bug.
I've didn't test that option for a long time.
I will check it!
Thanks for report!
I will check it later, code of calendar rows height has changed so most probably its gantt fault👎
fixed in 0.9.2