/** * <p> * Determine whether the given time (in milliseconds) is 'included' by the * Calendar. * </p> * * <p> * Note that this Calendar is only has full-day precision. * </p> */ @Override public boolean isTimeIncluded(long timeStamp) { // Test the base calendar first. Only if the base calendar not already // excludes the time/date, continue evaluating this calendar instance. if (super.isTimeIncluded(timeStamp) == false) { return false; } java.util.Calendar day = createJavaCalendar(timeStamp); return !(isDayExcluded(day)); }
java.util.Calendar day = getStartOfDayJavaCalendar(timeStamp); if (isDayExcluded(day) == false) { return timeStamp; // return the original value while (isDayExcluded(day) == true) { day.add(java.util.Calendar.DATE, 1);
/** * <p> * Redefine a certain day to be excluded (true) or included (false). * </p> */ public void setDayExcluded(java.util.Calendar day, boolean exclude) { if (exclude) { if (isDayExcluded(day)) { return; } excludeDays.add(day); dataSorted = false; } else { if (!isDayExcluded(day)) { return; } removeExcludedDay(day, true); } }
private AnnualCalendar getAnnualCalendar() { AnnualCalendar holidays = new AnnualCalendar(); Calendar calendar = new GregorianCalendar(2018, 5, 11); holidays.setDayExcluded(calendar, true); return holidays; }
/** * Remove the given day from the list of excluded days * * @param day the day to exclude */ public void removeExcludedDay(java.util.Calendar day) { removeExcludedDay(day, false); }
private void removeExcludedDay(java.util.Calendar day, boolean isChecked) { if (! isChecked && ! isDayExcluded(day)) { return;
holidayCal = new AnnualCalendar(); holidayCal.setDaysExcluded(calendars);
private Trigger buildCalendar(final EcTaskSchedulerDTO taskSchedulerDTO, final Trigger trigger) throws SchedulerException { logger.info("holidayName:" + taskSchedulerDTO.getHolidayName()); logger.info("holidays:" + taskSchedulerDTO.getHolidayDTOs()); if (taskSchedulerDTO.getHolidayName() != null && EcCollectionsUtils.isNotEmpty(taskSchedulerDTO.getHolidayDTOs())) { AnnualCalendar holidays = new AnnualCalendar(); for (EcHolidayDTO holidayDTO : taskSchedulerDTO.getHolidayDTOs()) { Calendar calendar = new GregorianCalendar(holidayDTO.getYear(), holidayDTO.getMonth() - 1, holidayDTO.getDay()); holidays.setDayExcluded(calendar, true); } scheduler.addCalendar(taskSchedulerDTO.getHolidayName(), holidays, true, true); return trigger.getTriggerBuilder().modifiedByCalendar(taskSchedulerDTO.getHolidayName()).build(); } else { return trigger.getTriggerBuilder().modifiedByCalendar(null).build(); } // return trigger; }
/** * Remove the given day from the list of excluded days * * @param day the day to exclude */ public void removeExcludedDay(java.util.Calendar day) { removeExcludedDay(day, false); }
private void removeExcludedDay(java.util.Calendar day, boolean isChecked) { if (! isChecked && ! isDayExcluded(day)) { return;
/** * <p> * Determine whether the given time (in milliseconds) is 'included' by the * Calendar. * </p> * * <p> * Note that this Calendar is only has full-day precision. * </p> */ @Override public boolean isTimeIncluded(long timeStamp) { // Test the base calendar first. Only if the base calendar not already // excludes the time/date, continue evaluating this calendar instance. if (super.isTimeIncluded(timeStamp) == false) { return false; } java.util.Calendar day = createJavaCalendar(timeStamp); return !(isDayExcluded(day)); }
/** * <p> * Redefine a certain day to be excluded (true) or included (false). * </p> */ public void setDayExcluded(java.util.Calendar day, boolean exclude) { if (exclude) { if (isDayExcluded(day)) { return; } excludeDays.add(day); dataSorted = false; } else { if (!isDayExcluded(day)) { return; } removeExcludedDay(day, true); } }
java.util.Calendar day = getStartOfDayJavaCalendar(timeStamp); if (isDayExcluded(day) == false) { return timeStamp; // return the original value while (isDayExcluded(day) == true) { day.add(java.util.Calendar.DATE, 1);
AnnualCalendar calendar=new AnnualCalendar(); if(dates!=null){ for(CalendarDate d:dates){ c.set(java.util.Calendar.MONTH,d.getMonthOfYear()); c.set(java.util.Calendar.DAY_OF_MONTH,d.getDayOfMonth()); calendar.setDayExcluded(c,true);
/** * Remove the given day from the list of excluded days * * @param day * @return */ public void removeExcludedDay(java.util.Calendar day) { removeExcludedDay(day, false); }
private void removeExcludedDay(java.util.Calendar day, boolean isChecked) { if (! isChecked && ! isDayExcluded(day)) { return;
/** * <p> * Determine whether the given time (in milliseconds) is 'included' by the * Calendar. * </p> * * <p> * Note that this Calendar is only has full-day precision. * </p> */ public boolean isTimeIncluded(long timeStamp) { // Test the base calendar first. Only if the base calendar not already // excludes the time/date, continue evaluating this calendar instance. if (super.isTimeIncluded(timeStamp) == false) { return false; } java.util.Calendar day = createJavaCalendar(timeStamp); return !(isDayExcluded(day)); }
/** * <p> * Redefine a certain day to be excluded (true) or included (false). * </p> */ public void setDayExcluded(java.util.Calendar day, boolean exclude) { if (exclude) { if (isDayExcluded(day)) { return; } excludeDays.add(day); dataSorted = false; } else { if (!isDayExcluded(day)) { return; } removeExcludedDay(day, true); } }
java.util.Calendar day = getStartOfDayJavaCalendar(timeStamp); if (isDayExcluded(day) == false) { return timeStamp; // return the original value while (isDayExcluded(day) == true) { day.add(java.util.Calendar.DATE, 1);
AnnualCalendar calendar=new AnnualCalendar(); if(dates!=null){ for(CalendarDate d:dates){ c.set(java.util.Calendar.MONTH,d.getMonthOfYear()); c.set(java.util.Calendar.DAY_OF_MONTH,d.getDayOfMonth()); calendar.setDayExcluded(c,true);