summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorDominik Picheta <dominikpicheta@gmail.com>2016-01-08 11:54:34 +0000
committerDominik Picheta <dominikpicheta@gmail.com>2016-01-08 11:54:34 +0000
commitfffdae32c71290af73c0897954733c53216ce434 (patch)
treef79ffd80e8661878b7297a4cd3c738a8837f950c /lib
parent09b159b8160c1063b323eb1ffb5751f283a52b57 (diff)
downloadNim-fffdae32c71290af73c0897954733c53216ce434.tar.gz
Fixed TimeInterval bug.
Diffstat (limited to 'lib')
-rw-r--r--lib/pure/times.nim15
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/pure/times.nim b/lib/pure/times.nim
index 3570ad37f..03745d54e 100644
--- a/lib/pure/times.nim
+++ b/lib/pure/times.nim
@@ -171,11 +171,6 @@ type
 {.deprecated: [TMonth: Month, TWeekDay: WeekDay, TTime: Time,
     TTimeInterval: TimeInterval, TTimeInfo: TimeInfo].}
 
-proc miliseconds*(t: TimeInterval): int {.deprecated.} = t.milliseconds
-
-proc `miliseconds=`*(t:var TimeInterval, milliseconds: int) {.deprecated.} =
-  t.milliseconds = milliseconds
-
 proc getTime*(): Time {.tags: [TimeEffect], benign.}
   ## gets the current calendar time as a UNIX epoch value (number of seconds
   ## elapsed since 1970) with integer precission. Use epochTime for higher
@@ -351,7 +346,6 @@ proc toSeconds(a: TimeInfo, interval: TimeInterval): float =
       else:
         curMonth.inc()
   result += float(newinterv.days * 24 * 60 * 60)
-  result += float(newinterv.days * 24 * 60 * 60)
   result += float(newinterv.hours * 60 * 60)
   result += float(newinterv.minutes * 60)
   result += float(newinterv.seconds)
@@ -383,6 +377,15 @@ proc `-`*(a: TimeInfo, interval: TimeInterval): TimeInfo =
   let secs = toSeconds(a, intval)
   result = getLocalTime(fromSeconds(t + secs))
 
+proc miliseconds*(t: TimeInterval): int {.deprecated.} = t.milliseconds
+
+proc `miliseconds=`*(t: var TimeInterval, milliseconds: int) {.deprecated.} =
+  ## An alias for a misspelled field in ``TimeInterval``.
+  ##
+  ## **Warning:** This should not be used! It will be removed in the next
+  ## version.
+  t.milliseconds = milliseconds
+
 when not defined(JS):
   proc epochTime*(): float {.rtl, extern: "nt$1", tags: [TimeEffect].}
     ## gets time after the UNIX epoch (1970) in seconds. It is a float