Skip to content

KenjiOhtsuka/DateTuner

Repository files navigation

Date Tuner

Kotlin Date Conversion Library

API Document

This library can generate and convert data objects, such as java.util.Date, java.time.YearMonth, java.time.LocalDate, etc.

Usage

Here are some example.

  • When you want to create current Date object.

    DateTuner.createCurrentDate()
  • When you want to create current YearMonth object.

    DateTuner.createCurrentYearMonth()
  • When you want to create previous YearMonth object.

    // Last month
    DateTuner.createPreviousYearMonth()
    // The month before last month
    // You can put offset as an argument
    DateTuber.createPreviousYearMonth(2)
  • When you want to get month number from a Date or YearMonth object, you can get it through the same method.

    DateTuner.getMonth(date)
    DateTuner.getMonth(yearMonth)

Gradle configuration

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

dependencies {
    implementation("com.github.KenjiOhtsuka:DateTuner:0.0.9")
}