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

Add kotlinx-datetime module (#198) #351

Merged
merged 9 commits into from
Jun 28, 2024
Merged

Add kotlinx-datetime module (#198) #351

merged 9 commits into from
Jun 28, 2024

Conversation

janseeger
Copy link
Contributor

@janseeger janseeger commented Jun 22, 2024

Fixes #198

Feel free to modify or decline

Copy link
Owner

@hfhbd hfhbd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, thanks for the PR, but please use the MPP plugin to not be limited to JVM only. Also, don't add a hardcoded dependency to Clock.System to enable mocking.

kotlinx-uuid-datetime/build.gradle.kts Outdated Show resolved Hide resolved

kotlin.jvmToolchain(11)

dependencies {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switch to commonSourceSet

allow("MIT")
}

publishing {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove, it's not needed with mpp

}
}

java {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove too

import kotlin.random.Random

@UUIDExperimentalAPI
public fun UUIDv7(random: Random = SecureRandom): UUID =
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't hardcode Clock System, instead add an Instant parameter, this should be enough.


@Test
fun testConversionInstant() {
val timestamp = Clock.System.now()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just use a hardcoded Instant

@hfhbd
Copy link
Owner

hfhbd commented Jun 28, 2024

Do you want to modify the PR? Otherwise I can take it too.

@janseeger
Copy link
Contributor Author

I can check to see if I find some time within the next week. But if you're quicker, feel free to take over the PR 👍

@hfhbd hfhbd enabled auto-merge (squash) June 28, 2024 12:53
@hfhbd hfhbd disabled auto-merge June 28, 2024 18:01
# Conflicts:
#	gradle/libs.versions.toml
@hfhbd hfhbd enabled auto-merge (squash) June 28, 2024 22:06
@hfhbd hfhbd merged commit 5636665 into hfhbd:main Jun 28, 2024
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add kotlinx-datetime interop module
2 participants