Package java.util

Examples of java.util.Date.before()


        Date endValue = getValue(endField, value);
        if(endValue == null) {
            return true;
        }

        if(endValue.before(startValue)) {
            context.buildConstraintViolationWithTemplate("EndBeforeStart")
                .addNode(annotation.end())
                .addConstraintViolation();
            return false;
        }
View Full Code Here


  public boolean isValid(Object value) {
    if ( value == null ) return true;
    if ( value instanceof Date ) {
      Date date = (Date) value;
      return date.before( new Date() );
    }
    else if ( value instanceof Calendar ) {
      Calendar cal = (Calendar) value;
      return cal.before( Calendar.getInstance() );
    }
View Full Code Here

  public boolean isValid(Object value) {
    if ( value == null ) return true;
    if ( value instanceof Date ) {
      Date date = (Date) value;
      return date.before( new Date() );
    }
    else if ( value instanceof Calendar ) {
      Calendar cal = (Calendar) value;
      return cal.before( Calendar.getInstance() );
    }
View Full Code Here

        int selectorRightPixel = scroller.getRightPosition() + 4;
        Float time = selectorRightPixel*timeUnit;

        Date startDate = new Date(start.getTime()+time.longValue());

        if(startDate.before(timelineWidget.getStartDate())) {
            startDate = timelineWidget.getStartDate();
        }

        return startDate;
    }
View Full Code Here

                // Find the real first point index
                int firstPointIndex = startPoint.intValue();
                for (int d = startPoint.intValue(); d < dr.getPoints().size(); d++) {
                    Date date = dr.getPoints().get(d).getDate();
                    if (date.after(from) && date.before(to)) {
                        firstPointIndex = d > 0 ? d - 1 : 0; // Reducing 1 for
                        // rendering
                        // purposes if
                        // possible
                        break;
View Full Code Here

                if (to.getTime() <= widget.getEndDate().getTime()) {
                    for (int d = endPoint.intValue(); d > startPoint.intValue(); d--) {
                        Date date = dr.getPoints().get(d).getDate();

                        if (date.after(from) && date.before(to)) {
                            if (d == dr.getPoints().size() - 1) {
                                lastPointIndex = d;
                            } else {
                                lastPointIndex = d + 1; // Adding 1 for
                            }
View Full Code Here

                        + time / 2L);
            }

            // Calculate start date
            Date start = new Date(center.getTime() - time / 2L);
            if (start.before(getStartDate())) {
                start = getStartDate();
            }

            // Calculate end date
            Date end = new Date(start.getTime() + time);
View Full Code Here

        }

        DateTimeFormat formatter = DateTimeFormat.getFormat("MMM d y");
        DateTimeFormat formatter2 = DateTimeFormat.getFormat("hh:mm a");

        if (monday.before(currentEndDate)) {
            while (monday.before(currentEndDate)) {
                Label lbl = new Label();
                lbl.setStyleName(CLASSNAME_SCALEDATE);
                lbl.setWidth(width + "px");
View Full Code Here

        DateTimeFormat formatter = DateTimeFormat.getFormat("MMM d y");
        DateTimeFormat formatter2 = DateTimeFormat.getFormat("hh:mm a");

        if (monday.before(currentEndDate)) {
            while (monday.before(currentEndDate)) {
                Label lbl = new Label();
                lbl.setStyleName(CLASSNAME_SCALEDATE);
                lbl.setWidth(width + "px");

                if (monday.getHours() == 0) {
View Full Code Here

        }

        DateTimeFormat formatter = DateTimeFormat.getFormat("MMM d y");
        DateTimeFormat formatter2 = DateTimeFormat.getFormat("hh:mm a");

        if (monday.before(currentEndDate)) {
            while (monday.before(currentEndDate)) {
                Label lbl = new Label();
                lbl.setStyleName(CLASSNAME_SCALEDATE);
                lbl.setWidth(width + "px");
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.