Ответ
fallen 16.08.2016 10:23
$othrow_date[^date::create[${form:ed_year}-${form:ed_month}-${form:ed_day}]]
$othrow_time[^date::create($othrow_date.year;$othrow_date.month;$othrow_date.day;$form:event_start_hour;$form:event_start_minute)]
$oSome_event[^int:sql{select event_duration from bcalendar_events where id='$category.id'}]
$oSE[^table::sql{select id from bcalendar_events where id='$category.id'}]
$oEvent_end_time[^date::create($othrow_time+^eval($oSome_event/1440))]
$oAll_today_events[^table::sql{select dt_start, dt_end from bcalendar where dt_start not between '^othrow_time.sql-string[]' and '^oEvent_end_time.sql-string[]'}]
^oSE.menu{
^if($oAll_today_events){
$oAtes[^date::create[$oAll_today_events.dt_start]]
$oAtee[^date::create[$oAll_today_events.dt_end]]
Извините, для выбранного интервала событие не подходит<br/>
Расчетный конец события $oSE.id - ${oEvent_end_time.year}-${oEvent_end_time.month}-${oEvent_end_time.day} ${oEvent_end_time.hour}:${oEvent_end_time.minute}<br />
</td>
}{
<td><a href="add_to_calendar.html?id=$category.id&ed_year=$form:ed_year&ed_month=$form:ed_month&ed_day=$form:ed_day&event_start_hour=$form:event_start_hour&event_start_minute=$form:event_start_minute">Добавить</a></td>
}
}