List of usage examples for java.time.temporal ChronoField ALIGNED_WEEK_OF_YEAR
ChronoField ALIGNED_WEEK_OF_YEAR
To view the source code for java.time.temporal ChronoField ALIGNED_WEEK_OF_YEAR.
Click Source Link
From source file:org.silverpeas.core.calendar.Recurrence.java
private Temporal computeDateForYearlyFrequencyFrom(final Temporal source, DayOfWeekOccurrence dayOfWeek) { final int lastDayOfYear = 31; Temporal current = source;/*from w w w . j a v a 2 s . co m*/ if (dayOfWeek.nth() > 1) { current = current.with(ChronoField.ALIGNED_WEEK_OF_YEAR, dayOfWeek.nth()); } else if (dayOfWeek.nth() < 0) { current = current.with(MonthDay.of(Month.DECEMBER, lastDayOfYear)) .plus(dayOfWeek.nth(), ChronoUnit.WEEKS).with(dayOfWeek.dayOfWeek()); } return current; }