Hello there, what's the ideal way of getting the l...
# kotlinx-datetime
a
Hello there, what's the ideal way of getting the local date of the end of the month
p
I’d do it like this:
Copy code
fun LocalDate.atEndOfMonth(): LocalDate {
  val atNextMonth = plus(DatePeriod(months = 1))
  return LocalDate(atNextMonth.year, atNextMonth.month, 1)
    .minus(DatePeriod(days = 1))
}
a
Thank you for your contribution