if (left + 410 > evt.getDesktopWidth())
left = evt.getDesktopWidth() - 410;
editEventWindow.setLeft(left + "px");
editEventWindow.setTop(top + "px");
CalendarEvent ce = evt.getCalendarEvent();
SimpleDateFormat edit_sdf = new SimpleDateFormat("HH:mm");
edit_sdf.setTimeZone(getCalendarCtrl().getCal().getDefaultTimeZone());
// Calendar calendar =
// Calendar.getInstance(org.zkoss.util.Locales.getCurrent());
String[] times = edit_sdf.format(ce.getBeginDate()).split(":");
int hours = Integer.parseInt(times[0]) * 2;
int mins = Integer.parseInt(times[1]);
int bdTimeSum = hours + mins;
if (mins >= 30)
hours++;
ppbt.setSelectedIndex(hours);
times = edit_sdf.format(ce.getEndDate()).split(":");
hours = Integer.parseInt(times[0]) * 2;
mins = Integer.parseInt(times[1]);
int edTimeSum = hours + mins;
if (mins >= 30)
hours++;
ppet.setSelectedIndex(hours);
boolean isAllday = (bdTimeSum + edTimeSum) == 0;
ppbegin.setTimeZone(getCalendarCtrl().getCal().getDefaultTimeZone());
ppbegin.setValue(ce.getBeginDate());
ppend.setTimeZone(getCalendarCtrl().getCal().getDefaultTimeZone());
ppend.setValue(ce.getEndDate());
ppallDay.setChecked(isAllday);
pplocked.setChecked(ce.isLocked());
ppbt.setVisible(!isAllday);
ppet.setVisible(!isAllday);
txtb_title.setValue(ce.getTitle());
ppcnt.setValue(ce.getContent());
String colors = ce.getHeaderColor() + "," + ce.getContentColor();
int index = 0;
if ("#3467CE,#668CD9".equals(colors))
index = 1;
else if ("#0D7813,#4CB052".equals(colors))
index = 2;