Modulo:Periodo attività musicale/sandbox: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
aggiornato alla versione corrente
periodi formati da un solo anno specificati ripetendo l'anno in inizio e fine
Riga 90:
local ns0 = mw.title.getCurrentTitle().namespace == 0
local sepCat = args.debug and '<br />' or ''
local singleYear = false
-- categorie configurate per il 'tipo artista' richiesto
Line 105 ⟶ 106:
table.insert(categories, cat)
else
ifstart = interval.start thenand string.format('[[%s]]', interval.start) or '?'
start = string.format('[[%s]]', interval.start)
elseif idx < #intervals then
start = '?'
end
end
 
Line 116 ⟶ 113:
table.insert(categories, cat)
else
ending = interval.ending and string.format('[[%s]]', interval.ending) or nil'?'
end
 
-- perse l'ultimosono intervallopiù cidi deveuno essere sempre lae inizio=fine, pergenera gliun altrisolo l'iniziolink
if #intervals > 1 and idxinterval.start == #intervalsinterval.ending then
formattedInterval = startidx == 1 and string.format('%s&nbsp;–&nbsp;%s', start, ending) or ending
singleYear = true
else
formattedInterval = ending and string.format('%s&nbsp;–&nbsp;%s', start, ending) or start
end
 
if interval.note then
local fmt = interval.note:sub(1, 1) == string.char(127) and
Line 137 ⟶ 136:
table.insert(categories, confCat.intermedi)
end
if singleYear then
-- categorizza le voci con uno o più periodi costituiti da un singolo anno
table.insert(categories, trackingCategory)
for idx, v in ipairs(intervals) do
local years = idx == #intervals and { v.ending, v.start } or { v.start, v.ending }
if years[1] and not years[2] then
table.insert(categories, trackingCategory)
break
end
end
end