get End LocalDate - Java java.time

Java examples for java.time:LocalDate

Description

get End LocalDate

Demo Code


//package com.java2s;
import java.time.LocalDate;
import java.time.temporal.ChronoUnit;

public class Main {
    private static LocalDate getEndLocalDate(LocalDate targetLocalDate,
            LocalDate endLocalDate, int baseDate, ChronoUnit chronoUnit) {
        if (targetLocalDate.getMonth() == endLocalDate.getMonth()
                && targetLocalDate.getDayOfMonth() >= baseDate) {
            endLocalDate = endLocalDate.plus(1, chronoUnit);
        }//from   ww  w  .  j  ava2 s .  co  m
        return endLocalDate;
    }
}

Related Tutorials