Skip to content

Commit

Permalink
wip: kotlinx-datetime
Browse files Browse the repository at this point in the history
  • Loading branch information
nesk committed Sep 20, 2024
1 parent 8c2eda2 commit 122635a
Show file tree
Hide file tree
Showing 8 changed files with 1,350 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added

- kotlinx-datetime integration to validate multiplatform datetimes ([#42](https://github.com/nesk/akkurate/issues/42))

## [0.9.1] - 2024-09-12

### Fixed
Expand Down
1 change: 1 addition & 0 deletions documentation/akkurate.tree
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<toc-element topic="constraints-reference.md"/>
<toc-element topic="integrations.topic">
<toc-element topic="arrow-integration.md"/>
<toc-element topic="kotlinx-datetime-integration.md"/>
</toc-element>
<toc-element toc-title="Tutorials">
<toc-element topic="ktor-validation-tutorial.md"/>
Expand Down
5 changes: 5 additions & 0 deletions documentation/topics/integrations.topic
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
<a href="arrow-integration.md" type="integration" />
<a href="#" type="server" summary="Once released, you will be able to automatically validate incoming requests with %product%.">Coming soon: Ktor</a>
</spotlight>

<primary>
<title>Other integrations</title>
<a href="kotlinx-datetime-integration.md" />
</primary>
</section-starting-page>

</topic>
22 changes: 22 additions & 0 deletions documentation/topics/kotlinx-datetime-integration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# kotlinx-datetime

[kotlinx-datetime](https://github.com/Kotlin/kotlinx-datetime) is an official multiplatform library for working with
date and time. %product% provides validation constraints for the various types of this library.

This article will guide you through the installation before using the available constraints.

## Installation

Before using %product% with kotlinx-datetime, you need to add the following dependency to your Gradle script:

<procedure title="Install %product%'s support library for kotlinx-datetime">

<code-block lang="kotlin">
implementation("dev.nesk.akkurate:akkurate-kotlinx-datetime:%version%")
</code-block>

</procedure>

## Available constraints

<include from="constraints-reference.md" element-id="kotlinx-datetime"></include>
22 changes: 22 additions & 0 deletions integrations/kotlinx-datetime/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import dev.nesk.akkurate.gradle.IgnoredTarget
import dev.nesk.akkurate.gradle.configureTargets

plugins {
id("akkurate.kmp-library-conventions")
id("org.jetbrains.dokka")
}

kotlin {
configureTargets(IgnoredTarget.WASM_WASI)

sourceSets {
commonMain.dependencies {
api(project(":akkurate-core"))
api(libs.kotlinx.datetime)
}

commonTest.dependencies {
implementation(project(":akkurate-test"))
}
}
}
Loading

0 comments on commit 122635a

Please sign in to comment.