Skip to content

Commit

Permalink
Prepare for 0.9.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
hotchemi committed May 17, 2017
1 parent 20aaeaa commit bc96795
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 14 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# ChangeLog

- 0.9.0
- Support Kotlin 1.1.2.
- Fix Fixed []DAY_OF_MONTH related bug](https://github.com/hotchemi/khronos/pull/15)
- Remove `Dates.now` to keep the consistency of API
- 0.1.0
- First release.
23 changes: 10 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ An intuitive Date extensions in Kotlin.
### Add durations to date

```kotlin
val now = Dates.now
val nextWeek = now + 1.week
val dayBeforeYesterday = now - 2.days
val today = Dates.today
val nextWeek = today + 1.week
val dayBeforeYesterday = today - 2.days

// shortcuts #1
val today = Dates.today
val tomorrow = Dates.tomorrow
val yesterday = Dates.yesterday

Expand All @@ -33,19 +32,19 @@ val firstCommitDate = Dates.of(year = 2016, month = 2, day = 26, hour = 18, minu
### Initialize by changing date components

```kotlin
val now = Dates.now
val christmas = now.with(month = 12, day = 25)
val thisSunday = now.with(weekday = 1)
val today = Dates.today
val christmas = today.with(month = 12, day = 25)
val thisSunday = today.with(weekday = 1)

// shortcuts
val newYearDay = now.beginningOfYear
val newYearsEve = now.endOfYear
val newYearDay = today.beginningOfYear
val newYearsEve = today.endOfYear
```

### Check day of the week

```kotlin
Dates.now.isFriday() // false
Dates.today.isFriday() // false
```

### Format and parse
Expand All @@ -62,7 +61,7 @@ Dates.now.isFriday() // false

```kotlin
1.day.ago > 2.days.ago // true
1.day.ago in 2.days.ago..Dates.now // true
1.day.ago in 2.days.ago..Dates.today // true
```

## Install
Expand All @@ -77,8 +76,6 @@ dependencies {

## Notice

- khronos doesn't support timezone yet so please don't use it in production.
- I'll fix it ASAP.
- khronos is definitely inspired by [naoty/Timepiece(Swift)](https://github.com/naoty/Timepiece).

## Licence
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
USER = hotchemi
GROUP_ID = com.github.hotchemi
ARTIFACT_ID = khronos
VERSION = 0.1.0
VERSION = 0.9.0
DESCRIPTION = An intuitive Date extensions in Kotlin.
WEBSITE = https://github.com/hotchemi/khronos
LICENCES = ['Apache-2.0']

0 comments on commit bc96795

Please sign in to comment.