Update for Nim 1.0.0 - Added format
for Durations. Remove deprecated functions.
This commit is contained in:
parent
08c0962b40
commit
600747e1ac
@ -14,15 +14,9 @@ proc format*(ti: TimeInterval, fmt: string): string =
|
|||||||
let info = (zeroTime + ti).utc
|
let info = (zeroTime + ti).utc
|
||||||
return info.format(fmt)
|
return info.format(fmt)
|
||||||
|
|
||||||
# Will be deprecated in Nim 0.18.1 as it will exist in the standard times module.
|
proc format*(d: Duration, fmt: string): string =
|
||||||
proc `-`*(a, b: DateTime): Duration {.deprecated} =
|
let info = (fromUnix(0) + d).utc
|
||||||
return times.`-`(a,b)
|
return info.format(fmt)
|
||||||
|
|
||||||
proc `<`*(a, b: DateTime): bool {.deprecated} =
|
|
||||||
return times.`<`(a,b)
|
|
||||||
|
|
||||||
proc `<=`*(a, b: DateTime): bool {.deprecated} =
|
|
||||||
return times.`<=`(a,b)
|
|
||||||
|
|
||||||
proc `<`*(a, b: TimeInterval): bool =
|
proc `<`*(a, b: TimeInterval): bool =
|
||||||
return (zeroTime + a) < (zeroTime + b)
|
return (zeroTime + a) < (zeroTime + b)
|
||||||
|
@ -1,11 +1,10 @@
|
|||||||
# Package
|
# Package
|
||||||
|
|
||||||
version = "0.5.1"
|
version = "0.5.2"
|
||||||
author = "Jonathan Bernard"
|
author = "Jonathan Bernard"
|
||||||
description = "Utility methods to fill in the lacking time support in Nim\'s stdlib."
|
description = "Utility methods to fill in the lacking time support in Nim\'s stdlib."
|
||||||
license = "BSD3"
|
license = "BSD3"
|
||||||
|
|
||||||
# Dependencies
|
# Dependencies
|
||||||
|
|
||||||
requires "nim >= 0.19.0"
|
requires "nim >= 1.0.0"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user