Package java.util

Examples of java.util.Calendar.before()


            if (object != null) {
                Calendar min = dateConstraint.minValue().getDate(false);
                Calendar max = dateConstraint.maxValue().getDate(true);
                Calendar date = Calendar.getInstance();
                date.setTime((Date) object);
                if (date.before(min)) errors.add(new ValidationError(field.getName(), errorCodes[2], dateConstraint, object));
                if (date.after(max)) errors.add(new ValidationError(field.getName(), errorCodes[3], dateConstraint, object));
            }
        }
        return errors;
    }
View Full Code Here


   
    Calendar ec = Calendar.getInstance();
    ec.setTime(timeRange[1]);
   
    assertTrue(sc.before(nc));
    assertTrue(ec.before(nc));
    assertTrue(sc.before(ec));
  }
 
  public void testGetTimeRangeDateThisMonth() throws Exception{
    Date[] timeRange = GnizrDaoUtil.getTimeRangeDate(TimeRange.THIS_MONTH);
View Full Code Here

      return false;
    }else{
      Date lastUpdated = cache.getLastUpdated();
      Calendar now = GregorianCalendar.getInstance();
      now.add(Calendar.MINUTE, (-1*cacheExpireInMinutes));
      if(now.before(lastUpdated) == true){
        return true;
      }
    }
    return false;
  }
View Full Code Here

        rayTimeCalendar.set(Calendar.HOUR_OF_DAY, hour);
        rayTimeCalendar.set(Calendar.MINUTE, minute);
        rayTimeCalendar.set(Calendar.SECOND, second);
        rayTimeCalendar.set(Calendar.MILLISECOND, milliSecond);

        if (rayTimeCalendar.before(volumeCalendar))
            rayTimeCalendar.add(Calendar.DAY_OF_MONTH, 1);

        rayTime = rayTimeCalendar.getTime();

        //
View Full Code Here

                    log.error("Error converting the expiration date ," + e.toString());
                    setExpirationFault(subscription);
                }
                Calendar calendarNow = Calendar.getInstance();
                if ((isValidDate(expiryElem.getText(), calendarExpires)) &&
                        (calendarNow.before(calendarExpires))) {
                    subscription.setExpires(calendarExpires);
                } else {
                    setExpirationFault(subscription);
                }
            }
View Full Code Here

                    } catch (Exception e) {
                        setExpirationFault(subscription);
                    }
                    Calendar calendarNow = Calendar.getInstance();
                    if ((isValidDate(expiryElem.getText(), calendarExpires)) &&
                            (calendarNow.before(calendarExpires))) {
                        subscription.setExpires(calendarExpires);
                    } else {
                        setExpirationFault(subscription);
                    }
View Full Code Here

                schedrun.set(Calendar.SECOND, getSecond());
                schedrun.set(Calendar.MINUTE, getMinute());
                schedrun.set(Calendar.HOUR_OF_DAY, getHour());
                schedrun.set(Calendar.DAY_OF_WEEK, getWeekDay());

                if (now.before(schedrun))
                {
                    // Scheduled time has NOT expired.
                    runtime = schedrun.getTime().getTime();
                }
                else
View Full Code Here

                schedrun.set(Calendar.SECOND, getSecond());
                schedrun.set(Calendar.MINUTE, getMinute());
                schedrun.set(Calendar.HOUR_OF_DAY, getHour());
                schedrun.set(Calendar.DAY_OF_MONTH, getDayOfMonth());

                if (now.before(schedrun))
                {
                    // Scheduled time has NOT expired.
                    runtime = schedrun.getTime().getTime();
                }
                else
View Full Code Here

                schedrun.set(Calendar.SECOND, getSecond());
                schedrun.set(Calendar.MINUTE, getMinute());
                schedrun.set(Calendar.HOUR_OF_DAY, getHour());

                // Scheduled time has NOT expired.
                if (now.before(schedrun))
                {
                    runtime = schedrun.getTime().getTime();
                }
                else
                {
View Full Code Here

        switch ( this.scheduleType ) {
            case DATE : return this.at;
            case DAILY : final Calendar next = Calendar.getInstance();
                         next.set(Calendar.HOUR_OF_DAY, this.hourOfDay);
                         next.set(Calendar.MINUTE, this.minuteOfHour);
                         if ( next.before(now) ) {
                             next.add(Calendar.DAY_OF_WEEK, 1);
                         }
                         return next.getTime();
            case WEEKLY : final Calendar nextW = Calendar.getInstance();
                          nextW.set(Calendar.HOUR_OF_DAY, this.hourOfDay);
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.