Package java.util

Examples of java.util.Date.compareTo()


    if (modifyDate != null) {
      HttpHeader lastModifiedHeader = doc.getHttpHeader("Last-Modified");
      if (lastModifiedHeader != null) {
        try {
          Date lastModifiedDate = df.parse(lastModifiedHeader.getValue());
          if (lastModifiedDate.compareTo(modifyDate) <= 0) {
            isNotModified = true;
          }
        } catch (ParseException e) {}
      }
    }
View Full Code Here


        Loan currentLoan;
        Date startDate;
        for (DcObject o : objects) {
            currentLoan = DataManager.getCurrentLoan(o.getID());
            startDate = (Date) currentLoan.getValue(Loan._A_STARTDATE);
            if (startDate.compareTo(endDate) > 0) {
                DcSwingUtilities.displayWarningMessage("msgEndDateMustBeAfterStartDate");
                return;
            }
        }
       
View Full Code Here

        Date start = (Date) loan.getValue(Loan._A_STARTDATE);
        Date end = (Date) loan.getValue(Loan._B_ENDDATE);
        Date current = new Date();
        if (end != null)
            available = true;
        else if (start != null && current.compareTo(start) >= 0)
            available = false;
       
        return available;
    }
   
View Full Code Here

     
      Date oPrjEnd = DBCommand.queryDateTime(oConn, "SELECT "+DB.dt_end+" FROM "+DB.k_projects+" WHERE "+DB.gu_project+"='"+getString(DB.gu_project)+"'");
      boolean bUpdateProject = false;
      if (oPrjEnd==null)
        bUpdateProject = true;
      else if (oPrjEnd.compareTo(dtEnd)<0)
        bUpdateProject = true;
    if (bUpdateProject)
      Project.setEndDate(oConn, getString(DB.gu_project), dtEnd);
    } // fi
View Full Code Here

            compareDate = formater.parse(formater
                .format(new Date()));
          } // else (compareString.length()>0)

          // First comparison against the begin date.
          int comparison = compareDate.compareTo(beginDate);

          if (comparison > -1 && endDate != null)
          { // The compared date lies not before the begin date and
            // there is an end date.
            if (beginDate.compareTo(endDate) == 1)
View Full Code Here

            else
            { // Begin and end date form a sensilbe interval.
              // Compare against the end date.
              // Already sure: the compare date is not before the
              // begin date.
              comparison = compareDate.compareTo(endDate);
              if (comparison == -1)
                // Before end date means that it is in the
                // interval.
                comparison = 0;
            } // else (beginDate.compareTo(endDate)==1)
View Full Code Here

      /* Default: Sort by Date */
      Date date1 = DateUtils.getRecentDate(news1.getNews());
      Date date2 = DateUtils.getRecentDate(news2.getNews());

      return date2.compareTo(date1);
    }

    void setAscending(boolean ascending) {
      fNewsComparator.setAscending(ascending);
    }
View Full Code Here

    Collections.sort(fRecentNews, new Comparator<INews>() {
      public int compare(INews news1, INews news2) {
        Date date1 = DateUtils.getRecentDate(news1);
        Date date2 = DateUtils.getRecentDate(news2);

        return date2.compareTo(date1);
      }
    });

    /* Dispose old News first */
    Control[] children = fInnerContentCircle.getChildren();
View Full Code Here

        /* Feed was visited Today */
        if (date.getTime() >= todayMillis)
          new EntityGroupItem(gToday, news);

        /* Feed was visited Yesterday */
        else if (date.compareTo(yesterday) >= 0)
          new EntityGroupItem(gYesterday, news);

        /* Feed was visited Two Weeks Ago */
        else if (date.compareTo(earlierThisWeek) >= 0)
          new EntityGroupItem(gEarlierThisWeek, news);
View Full Code Here

        /* Feed was visited Yesterday */
        else if (date.compareTo(yesterday) >= 0)
          new EntityGroupItem(gYesterday, news);

        /* Feed was visited Two Weeks Ago */
        else if (date.compareTo(earlierThisWeek) >= 0)
          new EntityGroupItem(gEarlierThisWeek, news);

        /* Feed was visited Last Week */
        else if (date.compareTo(lastWeek) >= 0)
          new EntityGroupItem(gLastWeek, news);
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.