@@ -9,6 +9,7 @@ package kotlinx.datetime
99import kotlinx.datetime.format.*
1010import kotlinx.datetime.internal.safeMultiply
1111import kotlinx.datetime.internal.*
12+ import kotlinx.datetime.plus
1213import kotlinx.datetime.serializers.*
1314import kotlinx.serialization.Serializable
1415import java.time.DateTimeException
@@ -107,3 +108,34 @@ internal actual fun Instant.plus(secondsToAdd: Long, nanosToAdd: Long): Instant
107108} catch (e: DateTimeException ) {
108109 throw IllegalArgumentException (e)
109110}
111+
112+ @JvmName(" minus" ) @PublishedApi internal fun minusJvm (instant : Instant , value : Int , unit : DateTimeUnit , timeZone : TimeZone ): Instant =
113+ instant.minus(value, unit, timeZone)
114+
115+ @JvmName(" periodUntil" ) @PublishedApi internal fun periodUntilJvm (
116+ start : Instant , end : Instant , timeZone : TimeZone
117+ ): DateTimePeriod = start.periodUntil(end, timeZone)
118+
119+ @JvmName(" plus" ) @PublishedApi internal fun plusJvm (
120+ instant : Instant , value : Int , unit : DateTimeUnit , timeZone : TimeZone
121+ ): Instant = instant.plus(value, unit, timeZone)
122+
123+ @JvmName(" plus" ) @PublishedApi internal fun plusJvm (
124+ instant : Instant , value : Long , unit : DateTimeUnit .TimeBased
125+ ): Instant = instant.plus(value, unit)
126+
127+ @JvmName(" plus" ) @PublishedApi internal fun plusJvm (
128+ instant : Instant , value : Long , unit : DateTimeUnit , timeZone : TimeZone
129+ ): Instant = instant.plus(value, unit, timeZone)
130+
131+ @JvmName(" plus" ) @PublishedApi internal fun plusJvm (
132+ instant : Instant , period : DateTimePeriod , timeZone : TimeZone
133+ ): Instant = instant.plus(period, timeZone)
134+
135+ @JvmName(" plus" ) @PublishedApi internal fun plusJvm (
136+ instant : Instant , unit : DateTimeUnit , timeZone : TimeZone
137+ ): Instant = instant.plus(1 , unit, timeZone)
138+
139+ @JvmName(" until" ) @PublishedApi internal fun untilJvm (
140+ start : Instant , end : Instant , unit : DateTimeUnit , timeZone : TimeZone
141+ ): Long = start.until(end, unit, timeZone)
0 commit comments