Package org.joda.time

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


        resource.setAdditionalField(ASGJanitorCrawler.ASG_FIELD_MAX_SIZE, "0");
        int suspensionAgeThreshold = 2;
        MonkeyCalendar calendar = new TestMonkeyCalendar();
        DateTime now = new DateTime(calendar.now().getTimeInMillis());
        resource.setAdditionalField(ASGJanitorCrawler.ASG_FIELD_LC_CREATION_TIME,
                String.valueOf(now.minusDays(suspensionAgeThreshold + 1).getMillis()));
        int retentionDays = 3;
        SuspendedASGRule rule = new SuspendedASGRule(calendar, suspensionAgeThreshold, retentionDays,
                new DummyASGInstanceValidator());
        Assert.assertTrue(rule.isValid(resource));
        Assert.assertNull(resource.getExpectedTerminationTime());
View Full Code Here


        if (stock != null) {
            DateTime dt = new DateTime(game.getVirtualCurrentDate());
            if(game.getVirtualCurrentDate() == null){
                play.Logger.warn("dt is null"+dt.getMillis());
            }
            dt = dt.minusDays(ApplicationConstants.STOCK_HISTORY_DAYS);
            //play.Logger.warn("Elsp : "+elsp.order());
            List<StockPrice> prices = StockPrice.find
                    .where()
                    .ge("date", new Timestamp(dt.getMillis()))
                    .lt("date", game.getVirtualCurrentDate())
View Full Code Here

  }

  @Test
  public void testYesterdaysDate() {
    DateTime date = new DateTime();
    date = date.minusDays(1);
    String expectedDate = date.toString("dd-MM-yyyy");
    assertEquals("Yesterays date", expectedDate, app.yesterdaysDate);
  }

  @Test
View Full Code Here

    return new DateTime().toString("dd-MM-yyyy");
  }

  public String getYesterdaysDate() {
    DateTime date = new DateTime();
    date = date.minusDays(1);
    return date.toString("dd-MM-yyyy");
  }

}
View Full Code Here

            //game length is in days
            int randStartDaysAgo = (int) (Math.random() * ApplicationConstants.MAX_DAYS_BACK)
                    + game.getGameLength()
                    + ApplicationConstants.DAYS_PADDING_FROM_REALITY;

            dt = dt.minusDays(randStartDaysAgo);
            Timestamp temp = new Timestamp(dt.getMillis());// the start of game is one year ago
            while (!TimeKeeper.isTradingDay(temp)) {
                temp = new Timestamp(temp.getTime() + TimeKeeper.aDayInMS);
                play.Logger.info("Skipping... " + temp);
            }
View Full Code Here

    @Test
    public void testCountOverDateRange() {
        DateTime now = DateTime.now();
        Date d3 = now.toDateMidnight().toDate();
        Date d2 = now.minusDays(1).toDateMidnight().toDate()
        Date d1 = now.minusDays(2).toDateMidnight().toDate()

        DailyUsageStats s1 = new DailyUsageStats(3L, 2L, 4L, 4L, d1);
        DailyUsageStats s2 = new DailyUsageStats(3L, 2L, 4L, 4L, d2);
        DailyUsageStats s3 = new DailyUsageStats(3L, 2L, 4L, 4L, d3);
View Full Code Here

    @Test
    public void testCountOverDateRange() {
        DateTime now = DateTime.now();
        Date d3 = now.toDateMidnight().toDate();
        Date d2 = now.minusDays(1).toDateMidnight().toDate()
        Date d1 = now.minusDays(2).toDateMidnight().toDate()

        DailyUsageStats s1 = new DailyUsageStats(3L, 2L, 4L, 4L, d1);
        DailyUsageStats s2 = new DailyUsageStats(3L, 2L, 4L, 4L, d2);
        DailyUsageStats s3 = new DailyUsageStats(3L, 2L, 4L, 4L, d3);
View Full Code Here

        DateTime dayToCompareEnd;

        DateTime dateTime = DateTime.parse(daySearch, DateTimeFormat.forPattern(datePattern));
        int dayOfWeek = dateTime.getDayOfWeek();
        if (dayOfWeek != 7) {
            dayToCompareStart = dateTime.minusDays(dayOfWeek);
            dayToCompareEnd = dateTime.plusDays(7 - dayOfWeek);
        } else {
            dayToCompareStart = dateTime;
            dayToCompareEnd = dateTime.plusDays(7);
        }
View Full Code Here

    service.retrieveStatus(null, Arrays.asList(forsendelsesId));
    String responsString = getFailedToPrintString();
    assertEquals("FailedToPrintId-list should be empty.", "[]", responsString);

    DateTime dateTime = new DateTime();
    dateTime = dateTime.minusDays(11);
    Date date = dateTime.toDate();

    PostMethod methodUpdatePrinted = new PostMethod(Constants.webContainer + "/service/rest/forsendelsesservice/updateSentToPrint/"+ forsendelsesId +"/"+date.getTime());
    HttpClient client = new HttpClient();
    int resultUpdatePrinted = client.executeMethod(methodUpdatePrinted);
View Full Code Here

        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));
        Assert.assertEquals(2L, cubeWrapper.getUniqueUsersForMonth(monthBegin.minusMonths(1)));
    }
}
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.