List of usage examples for java.time Month JULY
Month JULY
To view the source code for java.time Month JULY.
Click Source Link
From source file:Main.java
public static List<Employee> persons() { Employee p1 = new Employee(1, "Jake", Gender.MALE, LocalDate.of(1971, Month.JANUARY, 1), 2343); Employee p2 = new Employee(2, "Jack", Gender.MALE, LocalDate.of(1972, Month.JULY, 21), 7100); Employee p3 = new Employee(3, "Jane", Gender.FEMALE, LocalDate.of(1973, Month.MAY, 29), 5455); Employee p4 = new Employee(4, "Jode", Gender.MALE, LocalDate.of(1974, Month.OCTOBER, 16), 1800); Employee p5 = new Employee(5, "Jeny", Gender.FEMALE, LocalDate.of(1975, Month.DECEMBER, 13), 1234); Employee p6 = new Employee(6, "Jason", Gender.MALE, LocalDate.of(1976, Month.JUNE, 9), 3211); List<Employee> persons = Arrays.asList(p1, p2, p3, p4, p5, p6); return persons; }
From source file:Main.java
public static List<Employee> persons() { Employee p1 = new Employee(1, "Jake", Gender.MALE, LocalDate.of(1971, Month.JANUARY, 1), 2343.0); Employee p2 = new Employee(2, "Jack", Gender.MALE, LocalDate.of(1972, Month.JULY, 21), 7100.0); Employee p3 = new Employee(3, "Jane", Gender.FEMALE, LocalDate.of(1973, Month.MAY, 29), 5455.0); Employee p4 = new Employee(4, "Jode", Gender.MALE, LocalDate.of(1974, Month.OCTOBER, 16), 1800.0); Employee p5 = new Employee(5, "Jeny", Gender.FEMALE, LocalDate.of(1975, Month.DECEMBER, 13), 1234.0); Employee p6 = new Employee(6, "Jason", Gender.MALE, LocalDate.of(1976, Month.JUNE, 9), 3211.0); List<Employee> persons = Arrays.asList(p1, p2, p3, p4, p5, p6); return persons; }
From source file:Main.java
public static List<Employee> persons() { Employee p1 = new Employee(1, "Jake", Gender.MALE, LocalDate.of(1971, Month.JANUARY, 1), 2343.0); Employee p2 = new Employee(2, "Jack", Gender.MALE, LocalDate.of(1972, Month.JULY, 21), 7100.0); Employee p3 = new Employee(3, "Jane", Gender.FEMALE, LocalDate.of(1973, Month.MAY, 29), 5455.0); Employee p4 = new Employee(4, "Jode", Gender.MALE, LocalDate.of(1974, Month.OCTOBER, 16), 1800.0); Employee p5 = new Employee(5, "Jeny", Gender.FEMALE, LocalDate.of(1975, Month.DECEMBER, 13), 1234.0); Employee p6 = new Employee(6, "Jason", Gender.MALE, LocalDate.of(1976, Month.JUNE, 9), 3211.0); List<Employee> persons = Arrays.asList(p1, p2, p3, p4, p5, p6); return persons; }
From source file:Main.java
@Override public Boolean queryFrom(TemporalAccessor date) { int month = date.get(ChronoField.MONTH_OF_YEAR); if (month == Month.JULY.getValue() || month == Month.AUGUST.getValue()) { return true; }//from ww w . jav a 2s . c o m return false; }
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 ww w.jav a 2 s . c om return Quarter.FOURTH; } }
From source file:Main.java
public static List<Employee> persons() { Employee ken = new Employee(1, "Jame", Gender.MALE, LocalDate.of(1970, Month.MAY, 4), 6123.0); Employee jeff = new Employee(2, "Jeff", Gender.MALE, LocalDate.of(1971, Month.JULY, 5), 7112.0); Employee donna = new Employee(3, "Jane", Gender.FEMALE, LocalDate.of(1972, Month.JULY, 9), 8712.0); Employee chris = new Employee(4, "Jodd", Gender.MALE, LocalDate.of(1973, Month.DECEMBER, 6), 1823.0); Employee laynie = new Employee(5, "Janey", Gender.FEMALE, LocalDate.of(1974, Month.DECEMBER, 3), 1234.0); Employee lee = new Employee(6, "Jason", Gender.MALE, LocalDate.of(1975, Month.MAY, 8), 2412.0); // Create a list of persons List<Employee> persons = Arrays.asList(ken, jeff, donna, chris, laynie, lee); return persons; }
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) -> {// ww w. ja va 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; }
From source file:org.silverpeas.core.calendar.CalendarEventOccurrenceGenerationTest.java
@Test public void countEventOccurrencesInJuly() { List<CalendarEventOccurrence> occurrences = generator.generateOccurrencesOf(calendarEventsForTest(), in(YearMonth.of(2016, Month.JULY))); assertThat(occurrences.isEmpty(), is(false)); assertThat(occurrences.size(), is(4)); List<String> allEventIds = occurrences.stream() .map(o -> o.getCalendarEvent().getAttributes().get(ATTR_TEST_ID).get()) .collect(Collectors.toList()); assertThat(allEventIds.stream().distinct().allMatch(id -> id.equals("3") || id.equals("4")), is(true)); assertThat(allEventIds.stream().filter(id -> id.equals("3")).count(), is(3L)); assertThat(allEventIds.stream().filter(id -> id.equals("4")).count(), is(1L)); }
From source file:org.silverpeas.core.calendar.CalendarEventOccurrenceGenerationTest.java
@Test public void dateOfEventOccurrencesInJuly() { List<CalendarEventOccurrence> occurrences = generator.generateOccurrencesOf(calendarEventsForTest(), in(YearMonth.of(2016, Month.JULY))); assertThat(occurrences.size(), is(4)); // first occurrence Iterator<CalendarEventOccurrence> iterator = occurrences.iterator(); CalendarEventOccurrence occurrence = iterator.next(); assertThat(occurrence.getCalendarEvent().getAttributes().get(ATTR_TEST_ID).get(), is("3")); assertThat(occurrence.getStartDate(), is(dateTimeInUTC(2016, 7, 1, 9, 0))); assertThat(occurrence.getEndDate(), is(dateTimeInUTC(2016, 7, 1, 9, 15))); // second occurrence occurrence = iterator.next();//from w w w . j a v a2s . c o m assertThat(occurrence.getCalendarEvent().getAttributes().get(ATTR_TEST_ID).get(), is("3")); assertThat(occurrence.getStartDate(), is(dateTimeInUTC(2016, 7, 8, 9, 0))); assertThat(occurrence.getEndDate(), is(dateTimeInUTC(2016, 7, 8, 9, 15))); // third occurrence occurrence = iterator.next(); assertThat(occurrence.getCalendarEvent().getAttributes().get(ATTR_TEST_ID).get(), is("4")); assertThat(occurrence.getStartDate(), is(date(2016, 7, 11))); assertThat(occurrence.getEndDate(), is(date(2016, 7, 22))); // fourth occurrence occurrence = iterator.next(); assertThat(occurrence.getCalendarEvent().getAttributes().get(ATTR_TEST_ID).get(), is("3")); assertThat(occurrence.getStartDate(), is(dateTimeInUTC(2016, 7, 29, 9, 0))); assertThat(occurrence.getEndDate(), is(dateTimeInUTC(2016, 7, 29, 9, 15))); }