Timeline
Jump to navigation
Jump to search
Documentation for this module may be created at Module:Timeline/doc
local p = {}
local lang = mw.language.new("en")
function p.render( frame )
if not mw.smw then
return "mw.smw module not found"
end
local dates = {}
local startDate = frame.args["startDate"]
local timeRange = tonumber(frame.args["range"])
local fromDate = tostring(tonumber(lang:formatDate("Y", startDate))-timeRange).."-"..lang:formatDate("m-d", startDate)
local toDate = tostring(tonumber(lang:formatDate("Y", startDate))+timeRange).."-"..lang:formatDate("m-d", startDate)
local peopleBirthDates = mw.smw.ask("[[Category:Person]][[Person:Date of birth::>{{#time:"..fromDate.."}}]][[Person:Date of birth::<{{#time:"..toDate.."}}]]|?Person:Name|?Person:Date of birth")
local peopleDeathDates = mw.smw.ask("[[Category:Person]][[Person:Date of death::>{{#time:"..fromDate.."}}]][[Person:Date of death::<{{#time:"..toDate.."}}]]|?Person:Name|?Person:Date of death")
local compositionDates = mw.smw.ask("[[Category:Composition]][[Composition:Date::>{{#time:"..fromDate.."}}]][[Composition:Date::<{{#time:"..toDate.."}}]]|?Person:Title|?Composition:Date")
local result = ""
result = fromDate
return result
end
return p