Add TimeInterval reversing docstring

This commit is contained in:
Federico Ceratto
2017-07-29 11:42:03 +01:00
committed by GitHub
parent c3d5464e6f
commit a038c62bef

View File

@@ -301,6 +301,11 @@ proc `+`*(ti1, ti2: TimeInterval): TimeInterval =
result.years = carryO + ti1.years + ti2.years
proc `-`*(ti: TimeInterval): TimeInterval =
## Reverses a time interval
## .. code-block:: nim
##
## let day = -initInterval(hours=24)
## echo day # -> (milliseconds: 0, seconds: 0, minutes: 0, hours: 0, days: -1, months: 0, years: 0)
result = TimeInterval(
milliseconds: -ti.milliseconds,
seconds: -ti.seconds,