Skip to content

Commit

Permalink
iii_conventions/_26_In_Range
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennis Lotz committed Jan 15, 2018
1 parent 93a6426 commit eb2b021
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/iii_conventions/MyDate.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@ enum class TimeInterval {
YEAR
}

class DateRange(val start: MyDate, val endInclusive: MyDate)
class DateRange(val start: MyDate, val endInclusive: MyDate) {
operator fun contains(date: MyDate): Boolean = start <= date && date <= endInclusive
}
3 changes: 1 addition & 2 deletions src/iii_conventions/n26InRange.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,5 @@ fun todoTask26_(): Nothing = TODO(
)

fun checkInRange(date: MyDate, first: MyDate, last: MyDate): Boolean {
todoTask26_()
// return date in DateRange(first, last)
return date in DateRange(first, last)
}

0 comments on commit eb2b021

Please sign in to comment.