if (relativeX < 0 || relativeX >= getDatesWidth()) {
return;
}
Style s = getElement().getStyle();
Date from = calendarEvent.getStartTime();
Date to = calendarEvent.getEndTime();
long duration = to.getTime() - from.getTime();
if (!clickTargetsResize()
&& weekGrid.getCalendar().isEventMoveAllowed()) {
long daysMs = dayDiff * DateConstants.DAYINMILLIS;
from.setTime(startDatetimeFrom.getTime() + daysMs);
from.setTime(from.getTime()
+ ((long) halfHourInMilliSeconds * halfHourDiff));
to.setTime((from.getTime() + duration));
calendarEvent.setStartTime(from);
calendarEvent.setEndTime(to);
calendarEvent.setStart(new Date(from.getTime()));
calendarEvent.setEnd(new Date(to.getTime()));
// Set new position for the event
long startFromMinutes = (from.getHours() * 60) + from.getMinutes();
long range = calendarEvent.getRangeInMinutes();
startFromMinutes = calculateStartFromMinute(startFromMinutes, from,
to, dayOffsetPx);
if (startFromMinutes < 0) {
range += startFromMinutes;
}
updatePosition(startFromMinutes, range);
s.setLeft(dayOffsetPx, Unit.PX);
if (weekGrid.getDateCellWidths() != null) {
s.setWidth(weekGrid.getDateCellWidths()[dayOffset], Unit.PX);
} else {
setWidth(moveWidth);
}
} else if (clickTarget == topResizeBar) {