All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jdk7Main.common.extensions.PlatformLocalDate.jvm.kt Maven / Gradle / Ivy

package io.fluidsonic.stdlib


fun PlatformLocalDate.atEndOfDay(): PlatformLocalDateTime = atTime(PlatformLocalTime.MAX)


fun PlatformLocalDate.atEndOfDay(zone: PlatformZoneId): PlatformZonedDateTime {
	var localDateTime = atTime(PlatformLocalTime.MAX)
	if (zone !is PlatformZoneOffset) {
		val rules = zone.rules
		val transition = rules.getTransition(localDateTime)
		if (transition != null && transition.isGap) {
			localDateTime = transition.dateTimeBefore
		}
	}

	return PlatformZonedDateTime.of(localDateTime, zone)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy