dhtmlxScheduler events without end date

I want to display events without end_date (each event has only start_date defined, end_date is null) on month, week and day view, is it possible? Currently scheduler initialisation fails with " Cannot read property ‘valueOf’ of null" - which is fair enough, I just wondering is there a workaround?

Cheers,
enzo

You could try to use 9999 year in end_date to simulate event without end_date.
You could handle onEventLoading and if end_date isn’t set you could set date with 9999 year.
See article: docs.dhtmlx.com/scheduler/api__s … event.html

For example:

scheduler.attachEvent("onEventLoading", function(ev){
				if(!ev.end_date) {
					ev.end_date = new Date(9999, 1, 1);
				}
				return true;
});

I looked at the source code, it will not work, and in fact, it doesn’t. In this case on the calendar event looks like endless horizontal bar. I think it’s a basic use case, end date should be optional. Do you have any other suggestions?

Could you describe what you’re trying to achieve?
Don’t you want to show events without end date? In this case what is the way to set such date in the future?
Or possibly you want to show such events with some end date(calculated from start with fixed length). In this case what is the difference between common event and event without end date? In this case you could calculate this end_date in onEventLoading handler.

For example you have a team building in pub and this bloody event has no end_date, but the event has a start_date, and it should be possible to display it on the calendar (it’s obvious - it has start date). FullCalendar for example (product similar to the scheduler) has end_date as optional property for event, but I’ve implemented my solution using dhtmlx scheduler and now I have new requirement - event’s end_date could be null.

I want just display them on the calendar, the only workaround is to set start_date = end_date and use template for header:

 scheduler.templates.event_header = function(start,end,ev){
        return scheduler.templates.event_date(start)
    };

In this case it seems the easiest way is to set some dummy end_date to event and possibly mark it with some flag if necessary.

But it’s good to have this feature :slight_smile: