get Start LocalDate - Java java.time

Java examples for java.time:LocalDate

Description

get Start LocalDate

Demo Code


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

public class Main {
    private static LocalDate getStartLocalDate(LocalDate targetLocalDate,
            LocalDate startLocalDate, int baseDate, ChronoUnit chronoUnit) {
        if (targetLocalDate.getMonth() == startLocalDate.getMonth()
                && targetLocalDate.getDayOfMonth() < baseDate) {
            startLocalDate = startLocalDate.minus(1, chronoUnit);
        }/*www  .j  a v a 2  s .  com*/
        return startLocalDate;
    }
}

Related Tutorials