getRecDates issue

hi there -
I’m using RecDates and am having an issue with a variable. Here’s what the code looks like -

scheduler.attachEvent(“onClick”, function (id, e) {
myschedule_id = id.split("#",1);
mydates = scheduler.getRecDates(myschedule_id);

this gives me this error -
TypeError: c.start_date is undefined, dhtmlxscheduler_recurring.js (line 34)

If I do the following -
scheduler.attachEvent(“onClick”, function (id, e) {
test_id = id.split("#");
mydates = scheduler.getRecDates(test_id[0]);

it works fine. However, I need to do it the first way because I need that variable somewhere else. I’m assuming that this is just a newbie issue.
Thanks in advance,

This is vanila js issue, just change code as

myschedule_id = id.split("#",1); mydates = scheduler.getRecDates(myschedule_id[0]);