Example usage for java.time Month SEPTEMBER

List of usage examples for java.time Month SEPTEMBER

Introduction

In this page you can find the example usage for java.time Month SEPTEMBER.

Prototype

Month SEPTEMBER

To view the source code for java.time Month SEPTEMBER.

Click Source Link

Document

The singleton instance for the month of September with 30 days.

Usage

From source file:Main.java

public static void main(String[] args) {
    Month m = Month.SEPTEMBER;
    System.out.println(m.getValue());
    System.out.println(m.name());
    System.out.println(m.ordinal());
}

From source file:Main.java

public static void main(String[] argv) {
    LocalDate startEmployment = LocalDate.of(2010, Month.SEPTEMBER, 8);
    LocalDate today = LocalDate.now();
    Period period = startEmployment.until(today);
    System.out.println("period = " + period);
    long numberOfDays = startEmployment.until(today, DAYS);
    System.out.println("numberOfDays = " + numberOfDays);
}

From source file:se.backede.jeconomix.forms.report.SingleTransactionReport.java

private DefaultCategoryDataset createDataset(TransactionReportDto reports) {

    String lineTitle = "Kronor";

    Map<Month, BigDecimal> sums = new HashMap<>();

    List<Month> monthList = new LinkedList<>(Arrays.asList(Month.values()));

    monthList.forEach((month) -> {//from  ww w .  ja  va2s.  c o m
        sums.put(month, BigDecimal.valueOf(0));
    });

    reports.getTransctions().forEach((TransactionDto transaction) -> {
        monthList.stream().filter((month) -> (transaction.getBudgetMonth().equals(month)))
                .forEachOrdered((month) -> {
                    BigDecimal currentSum = sums.get(month);
                    if (transaction.getSum() != null) {
                        double abs = Math.abs(transaction.getSum().doubleValue());
                        BigDecimal newSum = currentSum.add(BigDecimal.valueOf(abs));
                        sums.put(month, newSum);
                    }
                });
    });

    DefaultCategoryDataset dataset = new DefaultCategoryDataset();
    dataset.addValue(sums.get(Month.JANUARY), lineTitle, "Jan");
    dataset.addValue(sums.get(Month.FEBRUARY), lineTitle, "Feb");
    dataset.addValue(sums.get(Month.MARCH), lineTitle, "Mar");
    dataset.addValue(sums.get(Month.APRIL), lineTitle, "Apr");
    dataset.addValue(sums.get(Month.MAY), lineTitle, "May");
    dataset.addValue(sums.get(Month.JUNE), lineTitle, "Jun");
    dataset.addValue(sums.get(Month.JULY), lineTitle, "Jul");
    dataset.addValue(sums.get(Month.AUGUST), lineTitle, "Aug");
    dataset.addValue(sums.get(Month.SEPTEMBER), lineTitle, "Sep");
    dataset.addValue(sums.get(Month.OCTOBER), lineTitle, "Oct");
    dataset.addValue(sums.get(Month.NOVEMBER), lineTitle, "Nov");
    dataset.addValue(sums.get(Month.DECEMBER), lineTitle, "Dec");
    return dataset;
}