List of usage examples for java.time Month minus
public Month minus(long months)
From source file:Main.java
public static void main(String[] args) { Month m = Month.from(LocalDate.now()); System.out.println(m.minus(8)); }
From source file:com.github.drbookings.LocalDates.java
public static boolean isLastThreeMonths(final LocalDate date) { final Month month = LocalDate.now().getMonth().minus(1); if (date.getMonth().equals(month) && (date.getYear() == LocalDate.now().getYear() || date.getYear() == LocalDate.now().getYear() - 1)) { return true; }//from w ww. j a v a 2 s.c om if (date.getMonth().equals(month.minus(1)) && (date.getYear() == LocalDate.now().getYear() || date.getYear() == LocalDate.now().getYear() - 1)) { return true; } return date.getMonth().equals(month.minus(2)) && (date.getYear() == LocalDate.now().getYear() || date.getYear() == LocalDate.now().getYear() - 1); }