commonMain.krono.utils.DaysOfMonth.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of krono-api-jvm Show documentation
Show all versions of krono-api-jvm Show documentation
An multiplatform interoperable datetime library
The newest version!
@file:JsExport
package krono.utils
import kotlinx.JsExport
import kotlin.js.JsName
@JsName("daysOfMonth")
fun DaysOfMonth(year: Int, month: Int): Int {
if (month == 2) return if (isLeapYear(year)) 29 else 28
return 31 - (month - 1) % 7 % 2
}