DHTMLx scheduler - units view

Is there an easy way to determine the units column which corresponds to an arbitrary x,y coordinate.



For example, for the day\week\month views you can use the following to return the equivalent start date on the calendar for a native event object:



var pos = dhtmlXScheduler._mouse_coords(e);

var start = dhtmlXScheduler._correct_shift(dhtmlXScheduler._min_date.valueOf() + (pos.y * dhtmlXScheduler.config.time_step + (dhtmlXScheduler._table_view ? 0 : pos.x) * 24 * 60) * 60000);



Before including the dhtmlxscheduler_units.js , add the next line


After that you will be able to use

var unit = scheduler._props[scheduler._mode].options[scheduler.__mouse_coords(e).x].key;