Example usage for java.time Month NOVEMBER

List of usage examples for java.time Month NOVEMBER

Introduction

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

Prototype

Month NOVEMBER

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

Click Source Link

Document

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

Usage

From source file:Main.java

public static void main(String[] args) {
    Month m = Month.NOVEMBER;
    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[] args) {
    ZoneId usChicago = ZoneId.of("America/Chicago");

    // 2014-03-09T02:30 did not exist in America/Chicago time zone
    LocalDateTime ldt = LocalDateTime.of(2014, Month.MARCH, 9, 2, 30);
    ZonedDateTime zdt = ZonedDateTime.of(ldt, usChicago);
    System.out.println(zdt);/*from   w w w  . j av  a 2  s .  co m*/

    // 2013-10-03T01:30 existed twice in America/Chicago time zone
    LocalDateTime ldt2 = LocalDateTime.of(2013, Month.NOVEMBER, 3, 1, 30);
    ZonedDateTime zdt2 = ZonedDateTime.of(ldt2, usChicago);

    System.out.println(zdt2.withEarlierOffsetAtOverlap());
    System.out.println(zdt2.withLaterOffsetAtOverlap());

}

From source file:Main.java

private static LocalDate thanksgiving(int year) {
    LocalDate thanksGiving = Year.of(year).atMonth(Month.NOVEMBER).atDay(1)
            .with(TemporalAdjusters.lastInMonth(DayOfWeek.WEDNESDAY));
    return thanksGiving;
}

From source file:Main.java

@Override
public Quarter queryFrom(TemporalAccessor temporal) {
    LocalDate now = LocalDate.from(temporal);

    if (now.isBefore(now.with(Month.APRIL).withDayOfMonth(1))) {
        return Quarter.FIRST;
    } else if (now.isBefore(now.with(Month.JULY).withDayOfMonth(1))) {
        return Quarter.SECOND;
    } else if (now.isBefore(now.with(Month.NOVEMBER).withDayOfMonth(1))) {
        return Quarter.THIRD;
    } else {/*from  w  w  w.  ja va 2 s .c  om*/
        return Quarter.FOURTH;
    }
}

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 w  w  w . j  av a  2  s  .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;
}