@@ -9,6 +9,7 @@ package kotlinx.datetime
9
9
import kotlinx.datetime.format.*
10
10
import kotlinx.datetime.internal.safeMultiply
11
11
import kotlinx.datetime.internal.*
12
+ import kotlinx.datetime.plus
12
13
import kotlinx.datetime.serializers.*
13
14
import kotlinx.serialization.Serializable
14
15
import java.time.DateTimeException
@@ -107,3 +108,34 @@ internal actual fun Instant.plus(secondsToAdd: Long, nanosToAdd: Long): Instant
107
108
} catch (e: DateTimeException ) {
108
109
throw IllegalArgumentException (e)
109
110
}
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