summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2015-03-12 16:18:55 +0100
committerAndreas Rumpf <rumpf_a@web.de>2015-03-12 16:18:55 +0100
commite0c3b8a45217811be7f23ff2b1f8b397a9c5489e (patch)
treee964c13888efde15fc19f8d7bd5b9f9039e6a65c /lib
parente025b97c1a8a65ca6e86a35aeb84e07cef34522a (diff)
parent44e68be13b8541bc88c4dede2df1b8ab08ba651e (diff)
downloadNim-e0c3b8a45217811be7f23ff2b1f8b397a9c5489e.tar.gz
Merge pull request #2321 from def-/times-js
Fix some compiler warnings in times
Diffstat (limited to 'lib')
-rw-r--r--lib/pure/times.nim17
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/pure/times.nim b/lib/pure/times.nim
index c39667611..149bb21df 100644
--- a/lib/pure/times.nim
+++ b/lib/pure/times.nim
@@ -26,9 +26,10 @@ type
   WeekDay* = enum ## represents a weekday
     dMon, dTue, dWed, dThu, dFri, dSat, dSun
 
-var
-  timezone {.importc, header: "<time.h>".}: int
-  tzname {.importc, header: "<time.h>" .}: array[0..1, cstring]
+when not defined(JS):
+  var
+    timezone {.importc, header: "<time.h>".}: int
+    tzname {.importc, header: "<time.h>" .}: array[0..1, cstring]
 
 when defined(posix) and not defined(JS):
   type
@@ -482,7 +483,7 @@ elif defined(JS):
     return newDate()
 
   const
-    weekDays: array [0..6, TWeekDay] = [
+    weekDays: array [0..6, WeekDay] = [
       dSun, dMon, dTue, dWed, dThu, dFri, dSat]
   
   proc getLocalTime(t: Time): TimeInfo =
@@ -490,7 +491,7 @@ elif defined(JS):
     result.minute = t.getMinutes()
     result.hour = t.getHours()
     result.monthday = t.getDate()
-    result.month = TMonth(t.getMonth())
+    result.month = Month(t.getMonth())
     result.year = t.getFullYear()
     result.weekday = weekDays[t.getDay()]
     result.yearday = 0
@@ -500,7 +501,7 @@ elif defined(JS):
     result.minute = t.getUTCMinutes()
     result.hour = t.getUTCHours()
     result.monthday = t.getUTCDate()
-    result.month = TMonth(t.getUTCMonth())
+    result.month = Month(t.getUTCMonth())
     result.year = t.getUTCFullYear()
     result.weekday = weekDays[t.getUTCDay()]
     result.yearday = 0
@@ -554,7 +555,7 @@ proc `$`*(day: WeekDay): string =
   return lookup[day]
 
 proc `$`*(m: Month): string =
-  ## stingify operator for ``TMonth``.
+  ## stingify operator for ``Month``.
   const lookup: array[Month, string] = ["January", "February", "March", 
       "April", "May", "June", "July", "August", "September", "October",
       "November", "December"]
@@ -1104,4 +1105,4 @@ when isMainModule:
   # Kitchen     = "3:04PM"
   s = "3:04PM"
   f = "h:mmtt"
-  echo "Kitchen: " & $s.parse(f)
\ No newline at end of file
+  echo "Kitchen: " & $s.parse(f)
devel&id=1b1bb284d2a5e221b105d133b05a2dbb228b122a'>1b1bb284d ^
0879f0b0a ^

5263d9d6f ^
93e03144f ^
1b1bb284d ^





2f48dbd16 ^
0879f0b0a ^
a1203cf84 ^
d20a8ac68 ^
b2e486b23 ^
9af85fb69 ^
1b1bb284d ^
1dd9ec85b ^
f2f16f645 ^






ca4b971bc ^
f2f16f645 ^


f04b502cf ^

9b29436f6 ^
f04b502cf ^

5a4122dc9 ^
809a4a77a ^

e9b665f33 ^

c60bb9464 ^
e9b665f33 ^

f04b502cf ^
1b1bb284d ^
809a4a77a ^

dce0b3b00 ^
b77ae66e8 ^
dce0b3b00 ^

93cd98dd1 ^
b7dd8e7df ^
5263d9d6f ^



035f0fb02 ^
25b4a0ab0 ^
035f0fb02 ^

8d2953e80 ^
e9b665f33 ^
a5ecbf823 ^

25b4a0ab0 ^


606288974 ^
25b4a0ab0 ^
4a720394b ^


16e800503 ^

4a720394b ^
88b5dd336 ^
c5c6bae2a ^

e5ae7ceaa ^
6e4cd3e5b ^

e5ae7ceaa ^

1b54be777 ^
567691220 ^

58282547f ^


44f672a51 ^

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111