core / io.islandtime / toWeekDate

toWeekDate

(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) inline fun <T> Date.toWeekDate(action: (year: Int, week: Int, day: Int) -> T): T

Converts this date to an ISO week date representation.

(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) inline fun <T> Date.toWeekDate(settings: WeekSettings, action: (year: Int, week: Int, day: Int) -> T): T

Converts this date to a week date representation using the week definition in settings.

(iosArm64, iosX64, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) inline fun <T> Date.toWeekDate(locale: <ERROR CLASS>, action: (year: Int, week: Int, day: Int) -> T): T

Converts this date to a week date representation using the week definition associated with the provided locale.

Keep in mind that that the system's calendar settings may differ from that of the default locale on some platforms. To respect the system calendar settings, use WeekSettings.systemDefault instead.

(jvm) inline fun <T> Date.toWeekDate(locale: Locale, action: (year: Int, week: Int, day: Int) -> T): T

Converts this date to a week date representation using the week definition associated with the provided locale.

Keep in mind that that the system's calendar settings may differ from that of the default locale on some platforms. To respect the system calendar settings, use WeekSettings.systemDefault instead.