lastDay

actual val lastDay: LocalDate(source)
expect val lastDay: LocalDate(source)

Returns the last day of the year-month.

Samples

import kotlinx.datetime.*
import kotlinx.datetime.format.*
import kotlinx.datetime.onDay
import kotlin.test.*

fun main() { 
   //sampleStart 
   // Getting the first and last day of a year-month
val yearMonth = YearMonth(2024, Month.FEBRUARY)
check(yearMonth.firstDay == LocalDate(2024, Month.FEBRUARY, 1))
check(yearMonth.lastDay == LocalDate(2024, Month.FEBRUARY, 29)) 
   //sampleEnd
}
actual val lastDay: LocalDate(source)