Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix visibility of nowImpl() #124

Merged
merged 1 commit into from
Aug 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package io.islandtime.clock.internal
import io.islandtime.*
import io.islandtime.clock.Clock

expect fun Date.Companion.nowImpl(clock: Clock): Date
expect fun DateTime.Companion.nowImpl(clock: Clock): DateTime
expect fun OffsetDateTime.Companion.nowImpl(clock: Clock): OffsetDateTime
expect fun ZonedDateTime.Companion.nowImpl(clock: Clock): ZonedDateTime
expect fun Time.Companion.nowImpl(clock: Clock): Time
expect fun OffsetTime.Companion.nowImpl(clock: Clock): OffsetTime
internal expect fun Date.Companion.nowImpl(clock: Clock): Date
internal expect fun DateTime.Companion.nowImpl(clock: Clock): DateTime
internal expect fun OffsetDateTime.Companion.nowImpl(clock: Clock): OffsetDateTime
internal expect fun ZonedDateTime.Companion.nowImpl(clock: Clock): ZonedDateTime
internal expect fun Time.Companion.nowImpl(clock: Clock): Time
internal expect fun OffsetTime.Companion.nowImpl(clock: Clock): OffsetTime
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,27 @@ import io.islandtime.*
import io.islandtime.clock.Clock
import io.islandtime.internal.*

actual fun Date.Companion.nowImpl(clock: Clock): Date {
internal actual fun Date.Companion.nowImpl(clock: Clock): Date {
return with(clock) { readInstant().toDateAt(zone) }
}

actual fun DateTime.Companion.nowImpl(clock: Clock): DateTime {
internal actual fun DateTime.Companion.nowImpl(clock: Clock): DateTime {
return with(clock) { readInstant().toDateTimeAt(zone) }
}

actual fun OffsetDateTime.Companion.nowImpl(clock: Clock): OffsetDateTime {
internal actual fun OffsetDateTime.Companion.nowImpl(clock: Clock): OffsetDateTime {
return with(clock) { readInstant().toOffsetDateTimeAt(zone) }
}

actual fun ZonedDateTime.Companion.nowImpl(clock: Clock): ZonedDateTime {
internal actual fun ZonedDateTime.Companion.nowImpl(clock: Clock): ZonedDateTime {
return with(clock) { readInstant() at zone }
}

actual fun Time.Companion.nowImpl(clock: Clock): Time {
internal actual fun Time.Companion.nowImpl(clock: Clock): Time {
return with(clock) { readInstant().toTimeAt(zone) }
}

actual fun OffsetTime.Companion.nowImpl(clock: Clock): OffsetTime {
internal actual fun OffsetTime.Companion.nowImpl(clock: Clock): OffsetTime {
return with(clock) { readInstant().toOffsetTimeAt(zone) }
}

Expand Down
12 changes: 6 additions & 6 deletions core/src/jvmMain/kotlin/io/islandtime/clock/internal/NowImpl.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,26 @@ package io.islandtime.clock.internal
import io.islandtime.*
import io.islandtime.clock.Clock

actual fun Date.Companion.nowImpl(clock: Clock): Date {
internal actual fun Date.Companion.nowImpl(clock: Clock): Date {
return with(clock) { readPlatformInstant().toDateAt(zone) }
}

actual fun DateTime.Companion.nowImpl(clock: Clock): DateTime {
internal actual fun DateTime.Companion.nowImpl(clock: Clock): DateTime {
return with(clock) { readPlatformInstant().toDateTimeAt(zone) }
}

actual fun OffsetDateTime.Companion.nowImpl(clock: Clock): OffsetDateTime {
internal actual fun OffsetDateTime.Companion.nowImpl(clock: Clock): OffsetDateTime {
return with(clock) { readPlatformInstant().toOffsetDateTimeAt(zone) }
}

actual fun ZonedDateTime.Companion.nowImpl(clock: Clock): ZonedDateTime {
internal actual fun ZonedDateTime.Companion.nowImpl(clock: Clock): ZonedDateTime {
return with(clock) { readPlatformInstant().toZonedDateTimeAt(zone) }
}

actual fun Time.Companion.nowImpl(clock: Clock): Time {
internal actual fun Time.Companion.nowImpl(clock: Clock): Time {
return with(clock) { readPlatformInstant().toTimeAt(zone) }
}

actual fun OffsetTime.Companion.nowImpl(clock: Clock): OffsetTime {
internal actual fun OffsetTime.Companion.nowImpl(clock: Clock): OffsetTime {
return with(clock) { readPlatformInstant().toOffsetTimeAt(zone) }
}