Package org.joda.time

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


                new Event(monthBegin.plusHours(1).plusMinutes(1), "bob"),
                new Event(monthBegin.plusHours(1).plusMinutes(2), "bob"),
                new Event(monthBegin.plusHours(1).plusMinutes(3), "frank"),
                new Event(monthBegin.plusHours(5).plusMinutes(2), "bob"),
                new Event(monthBegin.minusHours(1).plusMinutes(10), "bob"),
                new Event(monthBegin.minusHours(1).plusMinutes(5), "frank"),
                new Event(monthBegin.minusHours(1).plusMinutes(30), "frank"));
       
        CubeWrapper cubeWrapper = new CubeWrapper();
       
        for(Event event: events) {
View Full Code Here


                new Event(monthBegin.plusHours(1).plusMinutes(2), "bob"),
                new Event(monthBegin.plusHours(1).plusMinutes(3), "frank"),
                new Event(monthBegin.plusHours(5).plusMinutes(2), "bob"),
                new Event(monthBegin.minusHours(1).plusMinutes(10), "bob"),
                new Event(monthBegin.minusHours(1).plusMinutes(5), "frank"),
                new Event(monthBegin.minusHours(1).plusMinutes(30), "frank"));
       
        CubeWrapper cubeWrapper = new CubeWrapper();
       
        for(Event event: events) {
            cubeWrapper.put(event);
View Full Code Here

            cubeWrapper.put(event);
        }
       
        Assert.assertEquals(2L, cubeWrapper.getUniqueUsersForHour(monthBegin.plusHours(1)));
        Assert.assertEquals(1L, cubeWrapper.getUniqueUsersForHour(monthBegin.plusHours(5)));
        Assert.assertEquals(2L, cubeWrapper.getUniqueUsersForHour(monthBegin.minusHours(1)));
       
        Assert.assertEquals(2L, cubeWrapper.getUniqueUsersForDay(monthBegin));
        Assert.assertEquals(2L, cubeWrapper.getUniqueUsersForDay(monthBegin.minusDays(1)));
       
        Assert.assertEquals(2L, cubeWrapper.getUniqueUsersForMonth(monthBegin));
View Full Code Here

  }

  @Test
  public void testNoAndSeparator() {
    DateTime startDate = new DateTime();
    startDate = startDate.minusHours(2);
    TaskRun mostRecentTaskRun = new TaskRun(startDate.toDate(), startDate.plusHours(8).toDate(), "", "", "", 1);
    String printLastRun = formatter.printLastRun(mostRecentTaskRun);
    assertEquals("2 hours ago", printLastRun);

    startDate = new DateTime();
View Full Code Here

          /* ************************* Minus 3 Hours ************************** 2 -- V=1- NV=1*/
          /*   -------- TP VOTED: 1  -------- */
          /*   -------- TP NOT VOTED: 1  -------- */

          creationDate = creationDate.minusHours(3);
          this.createTweetPollItems(tag, creationDate.toDate(), answers,
                  Boolean.TRUE); // Voted

          this.createTweetPollItems(tag, creationDate.toDate(), answers, Boolean.FALSE);

View Full Code Here

          /* ************************* Minus 5 Hours ************************** 4 -- V=2 - NV=2 */
          /*   -------- TP VOTED: 2    -------- */
          /*   -------- TP NOT VOTED: 2 -------- */

          creationDate = new DateTime();
          creationDate = creationDate.minusHours(5);
          this.createTweetPollItems(tag, creationDate.toDate(), answers,
                  Boolean.TRUE); // Voted

          this.createTweetPollItems(tag, creationDate.toDate(), answers, Boolean.FALSE);
          this.createTweetPollItems(tag, creationDate.toDate(), answers, Boolean.FALSE);
View Full Code Here

          /* ************************* Minus 8 Hours ************************** 1 -- V=1 - NV=0 */
          /*   -------- TP VOTED: 1    -------- */
          /*   -------- TP NOT VOTED: 0 -------- */
          creationDate = new DateTime();
          creationDate = creationDate.minusHours(8);
          this.createTweetPollItems(tag, creationDate.toDate(), answers,
                  Boolean.TRUE); // Voted

          /* ************************* Minus 9 Hours **************************1 -- V=1 - NV=0 */
          /*   -------- TP VOTED: 1    -------- */
 
View Full Code Here

          /* ************************* Minus 9 Hours **************************1 -- V=1 - NV=0 */
          /*   -------- TP VOTED: 1    -------- */
          /*   -------- TP NOT VOTED: 0 -------- */
          creationDate = new DateTime();
          creationDate = creationDate.minusHours(9);
          this.createTweetPollItems(tag, creationDate.toDate(), answers,
                  Boolean.TRUE); // Voted

    }

View Full Code Here

  public void testFilterTweetpoll() throws NoSuchAlgorithmException,
      UnsupportedEncodingException {

    // Completed - Favourites - Scheduled - Published
    DateTime creationDate = new DateTime();
    creationDate = creationDate.minusHours(3);
    final SocialAccount socialAccount = createDefaultSettedSocialAccount(this.userAccount);

    final List<SocialProvider> providers = new ArrayList<SocialProvider>();
    providers.add(SocialProvider.FACEBOOK);
    providers.add(SocialProvider.LINKEDIN);
View Full Code Here

        final SocialAccount socialAccount = createDefaultSettedSocialAccount(this.secondary);
        final Long userId = this.secondary.getAccount().getUid();
        final String keyword = "What";
        // Completed - Favourites - Scheduled - Published
        DateTime creationDate = new DateTime();
        creationDate = creationDate.minusHours(3);

        // Completed - Favourites - Scheduled - Published
        this.createTweetPollItems(creationDate.toDate(),
                this.secondary.getAccount(), Boolean.TRUE, Boolean.FALSE,
                Boolean.FALSE, Boolean.TRUE);
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.