Examples of minusMinutes()


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

        if (ctime.endsWith("y")) return dateTime.minusYears(getCtimeNumber(ctime)).getMillis();
        if (ctime.endsWith("M")) return dateTime.minusMonths(getCtimeNumber(ctime)).getMillis();
        if (ctime.endsWith("w")) return dateTime.minusWeeks(getCtimeNumber(ctime)).getMillis();
        if (ctime.endsWith("d")) return dateTime.minusDays(getCtimeNumber(ctime)).getMillis();
        if (ctime.endsWith("h")) return dateTime.minusHours(getCtimeNumber(ctime)).getMillis();
        if (ctime.endsWith("m")) return dateTime.minusMinutes(getCtimeNumber(ctime)).getMillis();
        if (ctime.endsWith("s")) return dateTime.minusSeconds(getCtimeNumber(ctime)).getMillis();
        throw new IllegalArgumentException("Invalid option for ctime: "+ctime);
    }

    private int getCtimeNumber(String ctime) {
View Full Code Here

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

            callbackHandler.setStatement(SAML2CallbackHandler.Statement.AUTHN);
            callbackHandler.setIssuer("www.example.com");

            ConditionsBean conditions = new ConditionsBean();
            DateTime notBefore = new DateTime();
            conditions.setNotBefore(notBefore.minusMinutes(5));
            conditions.setNotAfter(notBefore.minusMinutes(3));
            callbackHandler.setConditions(conditions);

            InputStream sourceDocument = this.getClass().getClassLoader().getResourceAsStream("testdata/plain-soap-1.1.xml");
            String action = WSHandlerConstants.SAML_TOKEN_SIGNED;
View Full Code Here

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

            callbackHandler.setIssuer("www.example.com");

            ConditionsBean conditions = new ConditionsBean();
            DateTime notBefore = new DateTime();
            conditions.setNotBefore(notBefore.minusMinutes(5));
            conditions.setNotAfter(notBefore.minusMinutes(3));
            callbackHandler.setConditions(conditions);

            InputStream sourceDocument = this.getClass().getClassLoader().getResourceAsStream("testdata/plain-soap-1.1.xml");
            String action = WSHandlerConstants.SAML_TOKEN_SIGNED;
            Properties properties = new Properties();
View Full Code Here

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

        callbackHandler.setStatement(SAML2CallbackHandler.Statement.AUTHN);
        callbackHandler.setIssuer("www.example.com");
       
        ConditionsBean conditions = new ConditionsBean();
        DateTime notBefore = new DateTime();
        conditions.setNotBefore(notBefore.minusMinutes(5));
        conditions.setNotAfter(notBefore.minusMinutes(3));
        callbackHandler.setConditions(conditions);
       
        SAMLParms samlParms = new SAMLParms();
        samlParms.setCallbackHandler(callbackHandler);
View Full Code Here

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

        callbackHandler.setIssuer("www.example.com");
       
        ConditionsBean conditions = new ConditionsBean();
        DateTime notBefore = new DateTime();
        conditions.setNotBefore(notBefore.minusMinutes(5));
        conditions.setNotAfter(notBefore.minusMinutes(3));
        callbackHandler.setConditions(conditions);
       
        SAMLParms samlParms = new SAMLParms();
        samlParms.setCallbackHandler(callbackHandler);
        AssertionWrapper assertion = new AssertionWrapper(samlParms);
View Full Code Here

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

    TaskRun mostRecentTaskRun = new TaskRun(startDate.toDate(), startDate.plusHours(8).toDate(), "", "", "", 1);
    String printLastRun = formatter.printLastRun(mostRecentTaskRun);
    assertEquals("2 hours ago", printLastRun);

    startDate = new DateTime();
    startDate = startDate.minusMinutes(1);
    mostRecentTaskRun = new TaskRun(startDate.toDate(), startDate.plusSeconds(8).toDate(), "", "", "", 1);
    printLastRun = formatter.printLastRun(mostRecentTaskRun);
    assertEquals("1 minute ago", printLastRun);
  }
View Full Code Here

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

        final HashMap<DateClasificatedEnum, List<UtilNotification>> response = new HashMap<DateClasificatedEnum, List<UtilNotification>>();
        // today notification
        final List<Notification> todayNotifications = filterByDate(DateUtil.getTodayStartDate(), DateUtil.getNextDayMidnightDate());
        // this week (minus today)
        DateTime thisWeek = new DateTime(DateUtil.getTodayStartDate());
        thisWeek = thisWeek.minusMinutes(1);
        Date finalThisWeek = thisWeek.minusWeeks(1).toDate();
        final List<Notification> thisWeekList = filterByDate(finalThisWeek, thisWeek.toDate());
        // this months notifications
        final DateTime finalThisWeekMinusOne = new DateTime(finalThisWeek).minusMinutes(1);
        final DateTime finalThisMonth = finalThisWeekMinusOne.minusWeeks(3);
View Full Code Here

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

   
    if (start == null) {
      // set start to current time, rounded to hours
      DateTime startDate = DateTime.now();
      startDate = startDate.plusHours(1);
      startDate = startDate.minusMinutes(startDate.getMinuteOfHour());
      startDate = startDate.minusSeconds(startDate.getSecondOfMinute());
      startDate = startDate.minusMillis(startDate.getMillisOfSecond());
      start = startDate.toString();
    }
    ObjectNode startObj = JOM.createObjectNode();
View Full Code Here

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

    DateTime next = DateTime.now();
    next = next.minusMillis(next.getMillisOfSecond());
    next = next.minusSeconds(next.getSecondOfMinute());

    if (next.getMinuteOfHour() > 30) {
      next = next.minusMinutes(next.getMinuteOfHour());
      next = next.plusMinutes(60);
    } else {
      next = next.minusMinutes(next.getMinuteOfHour());
      next = next.plusMinutes(30);
    }
View Full Code Here

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

    if (next.getMinuteOfHour() > 30) {
      next = next.minusMinutes(next.getMinuteOfHour());
      next = next.plusMinutes(60);
    } else {
      next = next.minusMinutes(next.getMinuteOfHour());
      next = next.plusMinutes(30);
    }

    return next;
  }
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.