Modul:DateTime: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
update
(update) |
(update) |
||
Zeile 1: | Zeile 1: | ||
--[=[ 2014-03- | --[=[ 2014-03-21 | ||
Date and time utilities | Date and time utilities | ||
]=] | ]=] | ||
Zeile 14: | Zeile 14: | ||
monthsParse = { }, | monthsParse = { }, | ||
months4 = { } } | months4 = { } } | ||
local MaxYear = 2099 | |||
local Nbsp = mw.ustring.char( 160 ) | local Nbsp = mw.ustring.char( 160 ) | ||
local Tab = mw.ustring.char( 9 ) | local Tab = mw.ustring.char( 9 ) | ||
Zeile 52: | Zeile 53: | ||
{ spec = "c" }, | { spec = "c" }, | ||
[ "timestamp" ] = | [ "timestamp" ] = | ||
{ spec = "YmdHis" } | { spec = "YmdHis" }, | ||
[ "default" ] = | |||
{ spec = "H:i, j M Y", | |||
long = true }, | |||
[ "$dmy" ] = | |||
{ spec = "H:i, j M Y", | |||
long = true }, | |||
[ "$ymd" ] = | |||
{ spec = "H:i, Y M j", | |||
long = true }, | |||
[ "$dmyt" ] = | |||
{ spec = "j M Y, H:i", | |||
long = true }, | |||
[ "$dmyts" ] = | |||
{ spec = "j M Y, H:i:s", | |||
long = true }, | |||
[ "data-sort-type:date" ] = | |||
{ spec = "j M Y" } | |||
} | } | ||
World.templates.en = { } | World.templates.en = { } | ||
Zeile 891: | Zeile 909: | ||
local r = ( type( self ) == "table" ) | local r = ( type( self ) == "table" ) | ||
if r then | if r then | ||
local defs = { year = { max = | local defs = { year = { max = MaxYear }, | ||
month = { max = 12 }, | month = { max = 12 }, | ||
dom = { max = 31 }, | dom = { max = 31 }, | ||
Zeile 1.173: | Zeile 1.191: | ||
std = string.format( "%s%%%s", | std = string.format( "%s%%%s", | ||
std, stop ) | std, stop ) | ||
shift = string.format( "%s | shift = string.format( "%s%s", | ||
shift, stop ) | shift, stop ) | ||
end | end | ||
r = mw.ustring.gsub( r, | r = mw.ustring.gsub( r, std, shift ) | ||
end | end | ||
end | end | ||
Zeile 1.276: | Zeile 1.294: | ||
end | end | ||
if stamp then | if stamp then | ||
if low or template.long then | |||
if low or | |||
local scheme | local scheme | ||
if | if template.long then | ||
scheme = | scheme = mw.language.getContentLanguage() | ||
scheme = scheme.code | |||
end | end | ||
r2 = World.zones.formatter( assigned, scheme ) | r2 = World.zones.formatter( assigned, scheme ) |