Modul:DateTime: Unterschied zwischen den Versionen

Zur Navigation springen Zur Suche springen
317 Bytes hinzugefügt ,  1. Mai 2014
update
(update)
(update)
Zeile 1: Zeile 1:
--[=[ 2014-03-21
--[=[ 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
                     local mx = dk.max
                     if type( dk.max ) == "number" then
                    if type( mx ) == "number" then
                         ret = ( type( v ) == "number" )
                         ret = ( type( v ) == "number" )
                         if ret then
                         if ret then
                             ret = ( v >= 0 and  v <= mx
                            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
Anonymer Benutzer

Navigationsmenü