Package org.joda.time

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


      // 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

     * @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

        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

            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

        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

        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

        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

            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

        persistor.addReadings(readings);

        List<Reading> expectedReadings = new ArrayList<Reading>();
        for (int ii = 0; ii < 3; ii++) {
            BigDecimal temperature = new BigDecimal(234 + ii).movePointLeft(1);
            expectedReadings.add(new Reading(sensorId1, baseDate.plusMinutes(readingInterval * (ii + 4)),
                    temperature, 16, "W", BigInteger.valueOf(17L), false));
        }

        DateTime startTime = new DateTime(baseDate.plusMinutes(readingInterval * 4));
        DateTime endTime = new DateTime(baseDate.plusMinutes(readingInterval * 6));
 
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.