package com.flightfeather.monitor.utils
|
|
import java.time.LocalDate
|
|
object DateUtil {
|
|
fun findDurationDate(s: LocalDate, e: LocalDate): List<LocalDate> {
|
val res = mutableListOf<LocalDate>()
|
while (s.isBefore(e) || s.isEqual(e)) {
|
res.add(s)
|
s.plusDays(1)
|
}
|
return res
|
}
|
|
fun findDurationMonth(s: LocalDate, e: LocalDate): List<LocalDate> {
|
val res = mutableListOf<LocalDate>()
|
while (s.monthValue <= e.monthValue) {
|
res.add(s)
|
s.plusMonths(1)
|
}
|
return res
|
}
|
}
|