* luci/admin: fix inverted signedness of timezone specifiers
authorJo-Philipp Wich <jow@openwrt.org>
Sun, 20 Jul 2008 17:07:54 +0000 (17:07 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Sun, 20 Jul 2008 17:07:54 +0000 (17:07 +0000)
modules/admin-full/luasrc/model/cbi/admin_system/system.lua
modules/admin-mini/luasrc/model/cbi/mini/system.lua

index 260bac1..4e6342d 100644 (file)
@@ -23,8 +23,8 @@ s:option(Value, "hostname", translate("hostname"))
 tz = s:option(ListValue, "timezone", translate("timezone"))
 for k, offset in luci.util.vspairs(luci.http.protocol.date.TZ) do
        local zone = k:upper()  
-       local osgn = (offset > 0 and "+" or "")
-       local ohrs = math.floor(offset / 3600)
+       local osgn = (offset > 0 and "" or "+")
+       local ohrs = math.floor(-offset / 3600)
        local omin = (offset % 3600) / 60
        
        local ptz = zone .. osgn .. (ohrs ~= 0 and ohrs or "") .. (omin ~= 0 and ":" .. omin or "")
@@ -36,4 +36,4 @@ end
 s:option(Value, "log_size", nil, "kiB").optional = true
 s:option(Value, "log_ip").optional = true
 s:option(Value, "conloglevel").optional = true
-return m
\ No newline at end of file
+return m
index 06f8707..06064f9 100644 (file)
@@ -23,8 +23,8 @@ s:option(Value, "hostname", translate("hostname"))
 tz = s:option(ListValue, "timezone", translate("timezone"))
 for k, offset in luci.util.vspairs(luci.http.protocol.date.TZ) do
        local zone = k:upper()  
-       local osgn = (offset > 0 and "+" or "")
-       local ohrs = math.floor(offset / 3600)
+       local osgn = (offset > 0 and "" or "+")
+       local ohrs = math.floor(-offset / 3600)
        local omin = (offset % 3600) / 60
        
        local ptz = zone .. osgn .. (ohrs ~= 0 and ohrs or "") .. (omin ~= 0 and ":" .. omin or "")
@@ -33,4 +33,4 @@ for k, offset in luci.util.vspairs(luci.http.protocol.date.TZ) do
        tz:value(ptz, dtz)
 end
 
-return m
\ No newline at end of file
+return m