Ejemplo n.º 1
29
 public static void addAppointments(Iterable<Appointment> appointments) {
   String key;
   for (Appointment appointment : appointments) {
     key = Client.dateToString(appointment.getStartDate());
     System.out.println(key);
     if (Client.appointments.containsKey(key)) {
       if (!Client.appointments.get(key).contains(appointment)) {
         Client.appointments.get(key).add(appointment);
       }
     } else {
       Client.appointments.put(key, new ArrayList<Appointment>());
       Client.appointments.get(key).add(appointment);
     }
   }
 }
Ejemplo n.º 2
0
 public static void setActiveWeek(int year, int month, int date) {
   activeWeek.set(year, month, date);
   GregorianCalendar endOfActiveWeek = (GregorianCalendar) activeWeek.clone();
   endOfActiveWeek.add(GregorianCalendar.DATE, 7);
   Client.addAppointments(Appointment.getAppointments(user, activeWeek, endOfActiveWeek));
   while (
   /*activeWeek.get(GregorianCalendar.DAY_OF_MONTH) != 1 && */ activeWeek.get(
           GregorianCalendar.DAY_OF_WEEK)
       != /*activeWeek.getFirstDayOfWeek()*/ GregorianCalendar.MONDAY) {
     activeWeek.add(GregorianCalendar.DAY_OF_MONTH, -1);
   }
   System.out.println(Client.dateToString(activeWeek));
   for (ActiveWeekListener listener : activeWeekListeners) {
     listener.setActiveWeek(
         activeWeek.get(GregorianCalendar.YEAR),
         activeWeek.get(GregorianCalendar.MONTH),
         activeWeek.get(GregorianCalendar.DATE));
   }
 }
Ejemplo n.º 3
-18
 public static void setActiveWeek(GregorianCalendar g) {
   GregorianCalendar endG = (GregorianCalendar) g.clone();
   endG.add(GregorianCalendar.DATE, 7);
   Client.addAppointments(Appointment.getAppointments(user, g, endG));
   setActiveWeek(
       g.get(GregorianCalendar.YEAR),
       g.get(GregorianCalendar.MONTH),
       g.get(GregorianCalendar.DATE));
 }