Modul:DateTime: Unterschied zwischen den Versionen
Anfrage und copy gem https://de.wikipedia.org/w/index.php?title=Wikipedia%3AAdministratoren%2FAnfragen&type=revision&diff=173306645&oldid=173306492
(Die Seite wurde neu angelegt: „local DateTime = { serial = "2017-04-29", suite = "DateTime" } -- Date and time objects local Calc = { } local Meta = {…“) |
de>Wdwd (Anfrage und copy gem https://de.wikipedia.org/w/index.php?title=Wikipedia%3AAdministratoren%2FAnfragen&type=revision&diff=173306645&oldid=173306492) |
||
Zeile 1: | Zeile 1: | ||
local DateTime = { serial = " | local DateTime = { serial = "2018-01-24", | ||
suite = "DateTime" } -- Date and time objects | suite = "DateTime", | ||
item = 20652535 } -- Date and time objects | |||
local Calc = { } | local Calc = { } | ||
local Meta = { } | local Meta = { } | ||
Zeile 1.440: | Zeile 1.441: | ||
end | end | ||
if d == 29 and m == 2 and y then | if d == 29 and m == 2 and y then | ||
if y % 4 ~= 0 | if y % 4 ~= 0 or | ||
( y % 100 == 0 and | |||
y % 400 ~= 0 ) then | |||
ret = false | ret = false | ||
end | end | ||
Zeile 1.669: | Zeile 1.672: | ||
end | end | ||
end | end | ||
opts.london = adapt.london | opts.london = adapt.london | ||
opts.lonely = adapt.lonely | opts.lonely = adapt.lonely | ||
Zeile 2.161: | Zeile 2.163: | ||
since = frame.args[ 1 ] | since = frame.args[ 1 ] | ||
elseif s == "string" then | elseif s == "string" then | ||
since = mw.text.trim( since ) | since = mw.text.trim( since ) | ||
if since == "" then | if since == "" then | ||
since = false | since = false | ||
end | |||
end | |||
if since == "wikidata" then | |||
local item = DateTime.item | |||
since = false | |||
if type( item ) == "number" and item > 0 then | |||
local entity = mw.wikibase.getEntity( string.format( "Q%d", | |||
item ) ) | |||
if type( entity ) == "table" then | |||
local vsn = entity:formatPropertyValues( "P348" ) | |||
if type( vsn ) == "table" and | |||
type( vsn.value) == "string" and | |||
vsn.value ~= "" then | |||
r = vsn.value | |||
end | |||
end | |||
end | end | ||
end | end | ||
Zeile 2.175: | Zeile 2.190: | ||
r = Meta.serial | r = Meta.serial | ||
end | end | ||
elseif not r then | |||
r = Meta.serial | r = Meta.serial | ||
end | end |