Examples of after()


Examples of java.util.Calendar.after()

                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

Examples of java.util.Calendar.after()

    {
        Calendar aAsCalendar = (Calendar)objectA;
        Calendar bAsCalendar = (Calendar)objectB;
        int result = 0;

        if (bAsCalendar.after(aAsCalendar))
        {
            // set result to a negative integer if the first argument of this
            // method is less than the second
            result = -1;
        }
View Full Code Here

Examples of java.util.Calendar.after()

   
    Calendar ec = Calendar.getInstance();
    ec.setTime(timeRange[1]);
   
    assertTrue(sc.before(nc));
    assertTrue(ec.after(nc));
    assertTrue(sc.before(ec));   
    assertEquals(sc.get(Calendar.HOUR_OF_DAY),0);
    assertEquals(ec.get(Calendar.HOUR_OF_DAY),23);
    assertEquals(sc.get(Calendar.DAY_OF_MONTH),ec.get(Calendar.DAY_OF_MONTH));
  }
View Full Code Here

Examples of java.util.Calendar.after()

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

Examples of java.util.Calendar.after()

   
    Calendar ec = Calendar.getInstance();
    ec.setTime(timeRange[1]);
   
    assertTrue(sc.before(nc));
    assertTrue(ec.after(nc));
    assertTrue(sc.before(ec));
  }
 
  public void testDetectMIMEType() throws Exception{
    int mimeTypeId = GnizrDaoUtil.detectMIMEType("http://www.cnn.com");
View Full Code Here

Examples of java.util.Date.after()

            lastModified = parseTimestamp(stamp.toString());
           
            // can't be in the future - must be the previous year
            // add 2 days just to allow for different time zones
            cal.add(Calendar.DATE, 2);
            if (lastModified != null && lastModified.after(cal.getTime())) {
                cal.setTime(lastModified);
                cal.add(Calendar.YEAR, -1);
                lastModified = cal.getTime();
            }
        }
View Full Code Here

Examples of java.util.Date.after()

        }
                 
        // can't be in the future - must be the previous year
        // add 2 days just to allow for different time zones
        cal.add(Calendar.DATE, 2);
        if (lastModified != null && lastModified.after(cal.getTime())) {
            cal.setTime(lastModified);
            cal.add(Calendar.YEAR, -1);
            lastModified = cal.getTime();
        }
               
View Full Code Here

Examples of java.util.Date.after()

        for (int i = formatIndex; i < formats.length; i++, formatIndex++) {
            for (int j = 0; j < formats[i].length; j++) {
                try {
                    SimpleDateFormat dateFormatter = new SimpleDateFormat(formats[formatIndex][j], locale);
                    lastModified = dateFormatter.parse(lastModifiedStr);
                    if (lastModified.after(cal.getTime())) {
                        log.debug("Swapping to alternate format (found date in future)");
                        continue;
                    }
                    else // all ok, exit loop
                        return lastModified;
View Full Code Here

Examples of java.util.Date.after()

      //===== ENSURE the limitation on the primary dates
      //--- ensure the bounds
      for ( int rctr=resultList.size()-1;rctr>=0;rctr-- ){
        Date curDate = (Date)resultList.get(rctr);
        if ( ! ( (curDate.before(end) || curDate.equals(end)) &&
                 (curDate.after(start) || curDate.equals(start)) ) ){
          resultList.remove(rctr);
        }
      }
/*
      if ( TestRecurrance.debug ){
View Full Code Here

Examples of java.util.Date.after()

        }
        buff.append(size);
        buff.append(' ');
        Date now = new Date(), mod = new Date(fs.getLastModified(fileName));
        String date;
        if (mod.after(now) || Math.abs((now.getTime() - mod.getTime()) / 1000 / 60 / 60 / 24) > 180) {
            synchronized (dateFormatOld) {
                date = dateFormatOld.format(mod);
            }
        } else {
            synchronized (dateFormatNew) {
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.