בדוקי עריכות אוטומטית, אינטערפעיס רעדאקטארן, אינטערפעיס אדמיניסטראַטאָרן, סיסאפן, מייבאים, מעדכנים, מייבא, אספקלריה רעדאקטארן
46,364
רעדאגירונגען
(אימפארטירט, פאדערט צופאסונג) |
(אפדעיט) |
||
| שורה 489: | שורה 489: | ||
end | end | ||
function returnLatestData(property) | function returnLatestData(frame, property) | ||
local dateModule = require('Module:תאריך') | local dateModule = require('Module:תאריך') | ||
local propertyLink = require('Module:PropertyLink') | local propertyLink = require('Module:PropertyLink') | ||
local parenthesis = require('Module:סוגריים') | local parenthesis = require('Module:סוגריים') | ||
local timeProperty = { ' | local timeProperty = { 'P580', 'P582', 'P585' } | ||
local options = { | local options = { | ||
['qualifiers'] = timeProperty, | ['qualifiers'] = timeProperty, | ||
['allowMulti'] = true, | ['allowMulti'] = true, | ||
| שורה 502: | שורה 501: | ||
} | } | ||
local entityId = mw.wikibase.getEntityIdForCurrentPage() | local entityId = frame:getParent().args['qid'] or mw.wikibase.getEntityIdForCurrentPage() | ||
local res = propertyLink.getPropertyByOptions(property, entityId, options) | local res = propertyLink.getPropertyByOptions(property, entityId, options) | ||
return parenthesis.remove_parents_internal(res), parenthesis.only_parents_contents_internal(res) | |||
end | end | ||
function returnLatestMayor(frame) | function returnLatestMayor(frame) | ||
local mayor, latestMayorDate = returnLatestData('P6') | local mayor, latestMayorDate = returnLatestData(frame, 'P6') | ||
return mayor | return mayor | ||
end | end | ||
function returnLatestPopulation(frame) | function returnLatestPopulation(frame) | ||
local population, latestPopulationDate = returnLatestData('P1082') | local population, latestPopulationDate = returnLatestData(frame, 'P1082') | ||
return population | return population | ||
end | end | ||
function returnLatestPopulationDate(frame) | function returnLatestPopulationDate(frame) | ||
local population, latestPopulationDate = returnLatestData('P1082') | local population, latestPopulationDate = returnLatestData(frame, 'P1082') | ||
return latestPopulationDate | return latestPopulationDate | ||
end | end | ||
רעדאגירונגען