Modul:DateTime: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
update
(update) |
(update) |
||
Zeile 1: | Zeile 1: | ||
--[=[ 2014- | --[=[ 2014-04-30 | ||
Date and time utilities | Date and time utilities | ||
]=] | ]=] | ||
Zeile 910: | Zeile 910: | ||
if r then | if r then | ||
local defs = { year = { max = MaxYear }, | local defs = { year = { max = MaxYear }, | ||
month = { max = 12 }, | month = { min = 1, | ||
dom = { max = 31 }, | max = 12 }, | ||
dom = { min = 1, | |||
max = 31 }, | |||
hour = { max = 23 }, | hour = { max = 23 }, | ||
min = { max = 59 }, | min = { max = 59 }, | ||
Zeile 923: | Zeile 925: | ||
local dk = defs[ k ] | local dk = defs[ k ] | ||
if dk then | if dk then | ||
if type( dk.max ) == "number" then | |||
ret = ( type( v ) == "number" ) | ret = ( type( v ) == "number" ) | ||
if ret then | if ret then | ||
ret = ( v >= | local min | ||
if dk.min then | |||
min = dk.min | |||
else | |||
min = 0 | |||
end | |||
ret = ( v >= min and v <= dk.max | |||
and math.floor( v ) == v ) | and math.floor( v ) == v ) | ||
if ret and dk.f then | if ret and dk.f then |