add minutes and hours to Duration
This commit is contained in:
parent
63617e1b71
commit
993b60af35
1 changed files with 12 additions and 0 deletions
|
|
@ -85,6 +85,12 @@ class DurationInt(n: Int) {
|
|||
|
||||
def seconds = Duration(n, TimeUnit.SECONDS)
|
||||
def second = Duration(n, TimeUnit.SECONDS)
|
||||
|
||||
def minutes = Duration(60 * n, TimeUnit.SECONDS)
|
||||
def minute = Duration(60 * n, TimeUnit.SECONDS)
|
||||
|
||||
def hours = Duration(3600 * n, TimeUnit.SECONDS)
|
||||
def hour = Duration(3600 * n, TimeUnit.SECONDS)
|
||||
}
|
||||
|
||||
class DurationLong(n: Long) {
|
||||
|
|
@ -105,4 +111,10 @@ class DurationLong(n: Long) {
|
|||
|
||||
def seconds = Duration(n, TimeUnit.SECONDS)
|
||||
def second = Duration(n, TimeUnit.SECONDS)
|
||||
|
||||
def minutes = Duration(60 * n, TimeUnit.SECONDS)
|
||||
def minute = Duration(60 * n, TimeUnit.SECONDS)
|
||||
|
||||
def hours = Duration(3600 * n, TimeUnit.SECONDS)
|
||||
def hour = Duration(3600 * n, TimeUnit.SECONDS)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue