public String getHtmlValue(AppointmentBlock block) { RaplaLocale raplaLocale = getRaplaLocale(); final Date date = new Date(block.getEnd()); if (block.getAppointment().isWholeDaysSet()) { String dateString = raplaLocale.formatDateLong(DateTools.addDays(date, -1)); return dateString; } else { String dateString = raplaLocale.formatDateLong(date) + " " + raplaLocale.formatTime(date); return dateString; } }
private int getAppointmentNumber(AppointmentBlock appointmentBlock) { final long blockStart = appointmentBlock.getEnd(); final Date end = new Date(blockStart); final Appointment appointment = appointmentBlock.getAppointment(); final Reservation reservation = appointment.getReservation(); final Date start = reservation.getFirstDate(); SortedSet<AppointmentBlock> blocks = new TreeSet<AppointmentBlock>(); for (Appointment app : reservation.getAppointments()) { app.createBlocks(start, end, blocks); } final SortedSet<AppointmentBlock> headSet = blocks.headSet(appointmentBlock); final int size = headSet.size(); // final long appoimtmentStart = reservation.getFirstDate().getTime(); // if (appoimtmentStart == start) // { // return 1; // } return size + 1; }
public Object getValue(AppointmentBlock block) { return new Date(block.getEnd()); }
public AppointmentBlockEvalContext( Locale locale, int callStackDepth, String annotationName, AppointmentBlock block) { super(locale, callStackDepth, annotationName, block.getAppointment()); this.block = block; }