dhtmlxscheduler - end date of a reccuring event

I’m trying to build a custom logic of server side intergartion, but i need some explanation about the end date of an reccuring event with occurence number. How the end date of a reccuring event with occurence number is computed, on other terms i’m looking for a function take the type(with occurance) as parameter and return the end date (ex: f(Day_3__#4)=end_date(seconds)

Which server side language you are using?
We can provide helper class for php, which can simplify such tasks.