Examples of plusMinutes()


Examples of de.jetwick.util.MyDate.plusMinutes()

        twSearch.store(new JTweet(2L, "news about wikileaks", new JUser("userB")), false);

        // find dup is restricted to the last hour so use a current date
        MyDate dt = new MyDate();
        JTweet tw3 = new JTweet(3L, "wtf means wikileaks task force", new JUser("userC")).setCreatedAt(dt.toDate());
        JTweet tw4 = new JTweet(4L, "wtf wikileaks task force", new JUser("userD")).setCreatedAt(dt.plusMinutes(1).toDate());
        JTweet tw5 = new JTweet(5L, "RT @userC: wtf means wikileaks task force", new JUser("userE")).setCreatedAt(dt.plusMinutes(1).toDate());       
        twSearch.queueObjects(Arrays.asList(tw3, tw4, tw5));
        twSearch.forceEmptyQueueAndRefresh();
        assertEquals("should be empty. should NOT find tweet 4 because it is younger", 0, tw3.getDuplicates().size());
        assertEquals("should find tweet 3", 1, tw4.getDuplicates().size());
View Full Code Here

Examples of org.joda.time.DateTime.plusMinutes()

      // Convert to same DateTime in local time zone.
      int remoteOffset = -r.getRequestParameters().getParameterValue("timezoneOffset").toInt();
      int localOffset = DateTimeZone.getDefault().getOffset(null) / 60000;
      int minutesAdjustment = remoteOffset - localOffset;
      start = start.plusMinutes(minutesAdjustment);
      end = end.plusMinutes(minutesAdjustment);
    }
    EventSource source = getCalendar().getEventManager().getEventSource(sid);
    EventProvider provider = source.getEventProvider();
    String response = getCalendar().toJson(provider.getEvents(start, end));
View Full Code Here

Examples of org.joda.time.DateTime.plusMinutes()

      // Convert to same DateTime in local time zone.
      int remoteOffset = -r.getRequestParameters().getParameterValue("timezoneOffset").toInt();
      int localOffset = DateTimeZone.getDefault().getOffset(null) / 60000;
      int minutesAdjustment = remoteOffset - localOffset;
      start = start.plusMinutes(minutesAdjustment);
      end = end.plusMinutes(minutesAdjustment);
    }
    boolean allDay = r.getRequestParameters().getParameterValue("allDay").toBoolean();
    onSelect(new SelectedRange(start, end, allDay), new CalendarResponse(getCalendar(), target));

  }
View Full Code Here

Examples of org.joda.time.DateTime.plusMinutes()

     * @return a minute interval
     */
    public static String getIntervalInIso(final String day, final String hour, final String intervalLabel) {
        final String isoDate = getHourInIso(day,hour);
        DateTime dateTime = isoToDateTime(isoDate);
        dateTime = dateTime.plusMinutes(Integer.parseInt(intervalLabel));
        if (intervalLabel == "00") {
            dateTime = dateTime.plusHours(1).withMinuteOfHour(0);
        }
        return dateTimeToIsoNoMillis(dateTime);
    }
View Full Code Here

Examples of org.joda.time.DateTime.plusMinutes()

        Conditions conditions = conditionsBuilder.buildObject();
       
        if (conditionsBean == null) {
            DateTime newNotBefore = new DateTime();
            conditions.setNotBefore(newNotBefore);
            conditions.setNotOnOrAfter(newNotBefore.plusMinutes(5));
            return conditions;
        }
       
        int tokenPeriodMinutes = conditionsBean.getTokenPeriodMinutes();
        DateTime notBefore = conditionsBean.getNotBefore();
View Full Code Here

Examples of org.joda.time.DateTime.plusMinutes()

            DateTime newNotBefore = new DateTime();
            conditions.setNotBefore(newNotBefore);
            if (tokenPeriodMinutes <= 0) {
                tokenPeriodMinutes = 5;
            }
            conditions.setNotOnOrAfter(newNotBefore.plusMinutes(tokenPeriodMinutes));
        }
       
        if (conditionsBean.getAudienceURI() != null) {
            AudienceRestriction audienceRestriction =
                createAudienceRestriction(conditionsBean.getAudienceURI());
View Full Code Here

Examples of org.joda.time.DateTime.plusMinutes()

        SAMLObjectBuilder<Conditions> conditionsV2Builder =
                (SAMLObjectBuilder<Conditions>)builderFactory.getBuilder(Conditions.DEFAULT_ELEMENT_NAME);
        Conditions conditions = conditionsV2Builder.buildObject();
        DateTime newNotBefore = new DateTime();
        conditions.setNotBefore(newNotBefore);
        conditions.setNotOnOrAfter(newNotBefore.plusMinutes(5));
       
        XMLObjectBuilder<XSAny> xsAnyBuilder = builderFactory.getBuilder(XSAny.TYPE_NAME);
        XSAny attributeValue = xsAnyBuilder.buildObject(AttributeValue.DEFAULT_ELEMENT_NAME);
        attributeValue.getUnknownXMLObjects().add(conditions);
       
View Full Code Here

Examples of org.joda.time.DateTime.plusMinutes()

        return token;
    }

    private Date calculateExpiryDate(int expiryTimeInMinutes) {
        DateTime now = new DateTime();
        return now.plusMinutes(expiryTimeInMinutes).toDate();
    }

    public enum VerificationTokenType {

        lostPassword, emailVerification, emailRegistration
View Full Code Here

Examples of org.joda.time.DateTime.plusMinutes()

        List<Reading> readings = new ArrayList<Reading>();

        for (int ii = 0; ii < 10; ii++) {

            BigDecimal temperature = new BigDecimal(230 + ii).movePointLeft(1);
            readings.add(new Reading(sensorId1, baseDate.plusMinutes(readingInterval * ii), temperature,
                    16, "W", BigInteger.valueOf(17L), false));

            temperature = new BigDecimal(195 - ii).movePointLeft(1);
            readings.add(new Reading(sensorId2, baseDate.plusMinutes(readingInterval * ii), temperature,
                    24, "ESE", BigInteger.valueOf(17L), false));
View Full Code Here

Examples of org.joda.time.DateTime.plusMinutes()

            BigDecimal temperature = new BigDecimal(230 + ii).movePointLeft(1);
            readings.add(new Reading(sensorId1, baseDate.plusMinutes(readingInterval * ii), temperature,
                    16, "W", BigInteger.valueOf(17L), false));

            temperature = new BigDecimal(195 - ii).movePointLeft(1);
            readings.add(new Reading(sensorId2, baseDate.plusMinutes(readingInterval * ii), temperature,
                    24, "ESE", BigInteger.valueOf(17L), false));
        }

        persistor.addReadings(readings);

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.