Examples of minusWeeks()


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

                          1,
                          1,
                          0,
                          0).withWeekOfWeekyear(this.week);
     
      firstDateOfWeek = firstDateOfWeek.minusWeeks(PeriodSelector.this.numberOfPeriods);
     
      return firstDateOfWeek;
    }
    public DateTime getUpperBound(){
      DateTime lastDateOfWeek = new DateTime(year,
View Full Code Here

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

    private File createImage(ApplicationGroup appgroup) throws IOException {

        Map<String, Double> costs = Maps.newHashMap();
        DateTime end = new DateTime(DateTimeZone.UTC).withDayOfWeek(1).withMillisOfDay(0);
        Interval interval = new Interval(end.minusWeeks(numWeeks), end);

        for (Product product: products) {
            List<ResourceGroup> resourceGroups = getResourceGroups(appgroup, product);
            if (resourceGroups.size() == 0) {
                continue;
View Full Code Here

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

        DefaultCategoryDataset dataset = new DefaultCategoryDataset();

        for (Product product: products) {
            for (int week = 0; week < numWeeks; week++) {
                String weekStr = String.format("%s - %s week", formatter.print(end.minusWeeks(numWeeks-week)).substring(5), formatter.print(end.minusWeeks(numWeeks-week-1)).substring(5));
                dataset.addValue(costs.get(product + "|" + week), product.name, weekStr);
            }
        }

        JFreeChart chart = ChartFactory.createBarChart3D(
View Full Code Here

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

        DefaultCategoryDataset dataset = new DefaultCategoryDataset();

        for (Product product: products) {
            for (int week = 0; week < numWeeks; week++) {
                String weekStr = String.format("%s - %s week", formatter.print(end.minusWeeks(numWeeks-week)).substring(5), formatter.print(end.minusWeeks(numWeeks-week-1)).substring(5));
                dataset.addValue(costs.get(product + "|" + week), product.name, weekStr);
            }
        }

        JFreeChart chart = ChartFactory.createBarChart3D(
View Full Code Here

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

        if (file == null)
            return null;

        DateTime end = new DateTime(DateTimeZone.UTC).withDayOfWeek(1).withMillisOfDay(0);
        String link = getLink("area", ConsolidateType.hourly, appGroup, accounts, regions, end.minusWeeks(numWeeks), end);
        body.append(String.format("<b><h4><a href='%s'>%s</a> Weekly Costs:</h4></b>", link, appGroup.getDisplayName()));

        body.append("<table style=\"border: 1px solid #DDD; border-collapse: collapse\">");
        body.append("<tr style=\"background-color: whiteSmoke;text-align:center\" ><td style=\"border-left: 1px solid #DDD;\"></td>");
        for (int i = 0; i <= accounts.size(); i++) {
View Full Code Here

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

        }
        body.append("<td style=\"border-left: 1px solid #DDD;\"></td></tr>");

        Map<String, Double> costs = Maps.newHashMap();

        Interval interval = new Interval(end.minusWeeks(numWeeks), end);
        double[] total = new double[numWeeks];
        for (Product product: products) {
            List<ResourceGroup> resourceGroups = getResourceGroups(appGroup, product);
            if (resourceGroups.size() == 0) {
                continue;
View Full Code Here

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

            if (week == numWeeks-1)
                weekStr = "Last week";
            else
                weekStr = (numWeeks-week-1) + " weeks ago";
            String background = week % 2 == 1 ? "background: whiteSmoke;" : "";
            body.append(String.format("<tr style=\"%s\"><td nowrap style=\"border-left: 1px solid #DDD;padding: 4px\">%s (%s - %s)</td>", background, weekStr, formatter.print(currentWeekEnd.minusWeeks(1)).substring(5), formatter.print(currentWeekEnd).substring(5)));
            for (int i = 0; i < accounts.size(); i++) {
                Account account = accounts.get(i);
                for (int j = 0; j < regions.size(); j++) {
                    Region region = regions.get(j);
                    String key = account + "|" + region + "|" + week;
View Full Code Here

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

                for (int j = 0; j < regions.size(); j++) {
                    Region region = regions.get(j);
                    String key = account + "|" + region + "|" + week;
                    double cost = costs.get(key) == null ? 0 : costs.get(key);
                    Double lastCost = week == 0 ? null : costs.get(account + "|" + region + "|" + (week - 1));
                    link = getLink("column", ConsolidateType.daily, appGroup, Lists.newArrayList(account), Lists.newArrayList(region), currentWeekEnd.minusWeeks(1), currentWeekEnd);
                    body.append(getValueCell(cost, lastCost, link, firstLine));
                }
            }
            link = getLink("column", ConsolidateType.daily, appGroup, accounts, regions, currentWeekEnd.minusWeeks(1), currentWeekEnd);
            body.append(getValueCell(total[week], week == 0 ? null : total[week - 1], link, firstLine));
View Full Code Here

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

                    Double lastCost = week == 0 ? null : costs.get(account + "|" + region + "|" + (week - 1));
                    link = getLink("column", ConsolidateType.daily, appGroup, Lists.newArrayList(account), Lists.newArrayList(region), currentWeekEnd.minusWeeks(1), currentWeekEnd);
                    body.append(getValueCell(cost, lastCost, link, firstLine));
                }
            }
            link = getLink("column", ConsolidateType.daily, appGroup, accounts, regions, currentWeekEnd.minusWeeks(1), currentWeekEnd);
            body.append(getValueCell(total[week], week == 0 ? null : total[week - 1], link, firstLine));
            body.append("</tr>");
            firstLine = false;
            currentWeekEnd = currentWeekEnd.minusWeeks(1);
        }
View Full Code Here

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

            }
            link = getLink("column", ConsolidateType.daily, appGroup, accounts, regions, currentWeekEnd.minusWeeks(1), currentWeekEnd);
            body.append(getValueCell(total[week], week == 0 ? null : total[week - 1], link, firstLine));
            body.append("</tr>");
            firstLine = false;
            currentWeekEnd = currentWeekEnd.minusWeeks(1);
        }
        body.append("</table>");

        numberFormatter.setMaximumFractionDigits(0);
        numberFormatter.setMinimumFractionDigits(0);
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.