if(room.getAppointment() == false)
return null;
try{
Appointment appointment = AppointmentLogic.getInstance().getAppointmentByRoom(room_id);
Map returnMap = new HashMap();
returnMap.put("appointment", appointment);
Users us = Usermanagement.getInstance().getUserById(currentClient.getUser_id());
String jNameTimeZone = null;
if (us != null && us.getOmTimeZone() != null) {
jNameTimeZone = us.getOmTimeZone().getJname();
} else {
Configuration conf = Configurationmanagement.getInstance().getConfKey(3L, "default.timezone");
if (conf != null) {
jNameTimeZone = conf.getConf_value();
}
}
OmTimeZone omTimeZone = OmTimeZoneDaoImpl.getInstance().getOmTimeZone(jNameTimeZone);
Calendar cal = Calendar.getInstance();
cal.setTimeZone(TimeZone.getTimeZone(omTimeZone.getIcal()));
int offset = cal.get(Calendar.ZONE_OFFSET) + cal.get(Calendar.DST_OFFSET);
Date starttime = new Date(appointment.getAppointmentStarttime().getTime() + offset);
Date endtime = new Date(appointment.getAppointmentEndtime().getTime() + offset);
returnMap.put("appointment", appointment);
returnMap.put("start", CalendarPatterns.getDateWithTimeByMiliSeconds(starttime));
returnMap.put("end", CalendarPatterns.getDateWithTimeByMiliSeconds(endtime));