Skip to content

Kotlin Extension Functions for JSR310 (Java 8 Date & Time) APIs

Notifications You must be signed in to change notification settings

basshelal/ThreeTenKTX

Repository files navigation

ThreeTenKTX

minAPI 21

Kotlin extensions for JSR-310, for Java 8 and ThreeTenABP.

Installation

Add the JitPack repository to your root build.gradle at the end of repositories:

allprojects {
    repositories {
        ...
        maven { url "https://jitpack.io" }
    }
}

Add the dependency in your app module build.gradle file:

dependencies {
    implementation "com.github.basshelal.ThreeTenKTX:java8:0.1.1" // for Java 8 
    implementation "com.github.basshelal.ThreeTenKTX:threetenabp:0.1.1" // for ThreeTenABP
}

Example

Without ThreeTenKTX

Duration.between(LocalDate.now().atTime(17, 0), LocalDate.now().plusDays(1).atTime(2, 0))

With ThreeTenKTX

(today at 5.pm) till (tomorrow at 2.am)

About

Kotlin Extension Functions for JSR310 (Java 8 Date & Time) APIs

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages