Examples of Holiday


Examples of de.jollyday.Holiday

      int direction = (rtfw.getWhen() == When.BEFORE ? -1 : 1);
      while (date.getDayOfWeek() != xmlUtil.getWeekday(rtfw.getWeekday())) {
        date = date.plusDays(direction);
      }
      HolidayType type = xmlUtil.getType(rtfw.getLocalizedType());
      holidays.add(new Holiday(date, rtfw.getDescriptionPropertiesKey(), type));
    }
  }
View Full Code Here

Examples of de.jollyday.Holiday

        continue;
      }
      LocalDate date = calendarUtil.create(year, f);
      LocalDate movedDate = moveDate(f, date);
      HolidayType type = xmlUtil.getType(f.getLocalizedType());
      Holiday h = new Holiday(movedDate, f.getDescriptionPropertiesKey(), type);
      holidays.add(h);
    }
  }
View Full Code Here

Examples of de.jollyday.Holiday

   */
  protected void addChrstianHoliday(LocalDate day, String propertiesKey, HolidayType holidayType,
      Set<Holiday> holidays) {
    LocalDate convertedDate = calendarUtil.convertToISODate(day);
    de.jollyday.HolidayType type = xmlUtil.getType(holidayType);
    Holiday h = new Holiday(convertedDate, propertiesKey, type);
    holidays.add(h);
  }
View Full Code Here

Examples of de.jollyday.Holiday

      LocalDate day = calendarUtil.create(year, f.getDay());
      day = moveDateToFirstOccurenceOfWeekday(f, day);
      int days = determineNumberOfDays(f);
      day = f.getWhen() == When.AFTER ? day.plusDays(days) : day.minusDays(days);
      HolidayType type = xmlUtil.getType(f.getLocalizedType());
      holidays.add(new Holiday(day, f.getDescriptionPropertiesKey(), type));
    }
  }
View Full Code Here

Examples of net.sf.nachocalendar.holidays.HoliDay

   
    Set<Holiday> set = ReflectionUtils.getEnumInstances(Holiday.class);
    for (Holiday holiday: set)
    {
      System.out.print(holiday + "  ");
      HoliDay h = new DefaultHoliDay();
      h.setName(holiday.displayName());
      System.out.println(holiday.get(year));
      h.setDate(holiday.get(year));
      h.setRecurrent(true);
      model.addHoliDay(h);
    }
   
    return model;
  }
View Full Code Here

Examples of org.fenixedu.academic.domain.Holiday

    public ActionForward delete(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
            throws FenixServiceException {
        final String holidayIDString = request.getParameter("holidayID");
        if (holidayIDString != null && StringUtils.isNumeric(holidayIDString)) {
            final Holiday holiday = FenixFramework.getDomainObject(holidayIDString);

            DeleteHoliday.run(holiday);
        }
        return prepare(mapping, form, request, response);
    }
View Full Code Here

Examples of org.fenixedu.academic.domain.Holiday

                date = date.with(DateTimeFieldType.monthOfYear(), getMonthOfYear());
            }
            if (getDayOfMonth() != null) {
                date = date.with(DateTimeFieldType.dayOfMonth(), getDayOfMonth());
            }
            return new Holiday(date, getLocality());
        }
View Full Code Here

Examples of org.jbpm.cal.Holiday

    return dayPart;
  }

  private Holiday parseHoliday(Element holidayElement, DateFormat dayFormat, BusinessCalendar businessCalendar, Parse parse) {
    Holiday holiday = new Holiday();
    try {
      if (holidayElement.hasAttribute("date")) {
        String holidayText = holidayElement.getAttribute("date");
        Date holidayDate = dayFormat.parse(holidayText.trim());
        holiday.setToDay(holidayDate);
        holiday.setFromDay(holidayDate);
       
      } else if ( (holidayElement.hasAttribute("from"))
                  && (holidayElement.hasAttribute("to"))
                ) {
        String dayText = holidayElement.getAttribute("from");
        Date dayDate = dayFormat.parse(dayText.trim());
        holiday.setFromDay(dayDate);

        dayText = holidayElement.getAttribute("to");
        dayDate = dayFormat.parse(dayText.trim());
        holiday.setToDay(dayDate);
      }

      // now we are going to set the toDay to the end of the day, rather then the beginning.
      // we take the start of the next day as the end of the toDay.
      Calendar calendar = businessCalendar.createCalendar();
      calendar.setTime(holiday.getToDay());
      calendar.add(Calendar.DATE, 1);
      Date toDay = calendar.getTime();
      holiday.setToDay(toDay);
     
    } catch (Exception e) {
      parse.addProblem("couldn't parse holiday: "+XmlUtil.toString(holidayElement));
    }
View Full Code Here

Examples of org.jbpm.pvm.internal.cal.Holiday

    }
    return day;
  }
 
  private Holiday parseHoliday(Element holidayElement, DateFormat dayFormat, BusinessCalendar businessCalendar, Parse parse) {
    Holiday holiday = new Holiday();
    try {
      if (holidayElement.hasAttribute("period")) {
        String holidayPeriodText = holidayElement.getAttribute("period");
       
        int dashIndex = holidayPeriodText.indexOf('-');
       
        String fromDateText = null;
        String toDateText = null;
        if (dashIndex!=-1) {
          fromDateText = holidayPeriodText.substring(0, dashIndex).trim().toLowerCase();
          toDateText = holidayPeriodText.substring(dashIndex+1).trim().toLowerCase();
         
        } else {
          fromDateText = holidayPeriodText.trim().toLowerCase();
          toDateText = fromDateText;
        }

       
        Date fromDate = dayFormat.parse(fromDateText);
        holiday.setFromDay(fromDate);

        Date toDate = dayFormat.parse(toDateText);
        holiday.setToDay(toDate);
       
      } else {
        parse.addProblem("attribute 'period' in element business-calendar is required", holidayElement);
      }

      // now we are going to set the toDay to the end of the day, rather then the beginning.
      // we take the start of the next day as the end of the toDay.
      Calendar calendar = businessCalendar.createCalendar();
      calendar.setTime(holiday.getToDay());
      calendar.add(Calendar.DATE, 1);
      Date toDay = calendar.getTime();
      holiday.setToDay(toDay);
     
    } catch (Exception e) {
      parse.addProblem("couldn't parse holiday: "+XmlUtil.toString(holidayElement), holidayElement);
    }
View Full Code Here

Examples of org.jbpm.pvm.internal.cal.Holiday

    }
    return day;
  }
 
  private Holiday parseHoliday(Element holidayElement, DateFormat dayFormat, BusinessCalendarImpl businessCalendarImpl, Parse parse) {
    Holiday holiday = new Holiday();
    try {
      if (holidayElement.hasAttribute("period")) {
        String holidayPeriodText = holidayElement.getAttribute("period");
       
        int dashIndex = holidayPeriodText.indexOf('-');
       
        String fromDateText = null;
        String toDateText = null;
        if (dashIndex!=-1) {
          fromDateText = holidayPeriodText.substring(0, dashIndex).trim().toLowerCase();
          toDateText = holidayPeriodText.substring(dashIndex+1).trim().toLowerCase();
         
        } else {
          fromDateText = holidayPeriodText.trim().toLowerCase();
          toDateText = fromDateText;
        }

       
        Date fromDate = dayFormat.parse(fromDateText);
        holiday.setFromDay(fromDate);

        Date toDate = dayFormat.parse(toDateText);
        holiday.setToDay(toDate);
       
      } else {
        parse.addProblem("attribute 'period' in element business-calendar is required", holidayElement);
      }

      // now we are going to set the toDay to the end of the day, rather then the beginning.
      // we take the start of the next day as the end of the toDay.
      Calendar calendar = businessCalendarImpl.createCalendar();
      calendar.setTime(holiday.getToDay());
      calendar.add(Calendar.DATE, 1);
      Date toDay = calendar.getTime();
      holiday.setToDay(toDay);
     
    } catch (Exception e) {
      parse.addProblem("couldn't parse holiday: "+XmlUtil.toString(holidayElement), holidayElement);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.