mmantach
mmantach

Reputation: 148

How can I get the date after clicking on calender in yearly view in dhtmlx scheduler?

When i click on a date i need to take the selected date, it's working fine on daily, weekly and monthly view by using code below :

scheduler.attachEvent("onEmptyClick", function(date , event){ alert(date); });

but, the date variable don't return a correct value in case of yearly view

Does anyone have a solution for this issue?

Upvotes: 1

Views: 1103

Answers (2)

Maaaark
Maaaark

Reputation: 239

A little late but here is the solution, since i ran into the same issue

scheduler.attachEvent("onClick", function (id, e){
  var clickedDate = scheduler.getActionData(e);
  console.log("clickedDate", clickedDate.date);      
});

Upvotes: 0

Aquatic
Aquatic

Reputation: 5154

The above will not work in next two cases

  • clicking on date with events ( not empty click )
  • clicking on month name, week name or empty space ( onEmptyClick event will be triggered, but will have null instead of date )

Only clicking on day cells will trigger onEmptyClick event with valid date.

Upvotes: 0

Related Questions