Modulo:Data: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
m messaggio |
fix nome funzione, +tonumber |
||
Riga 26:
return {
d1 = tonumber(mw.getContentLanguage():formatDate('U', args.to)),
d2 = tonumber(args.from and mw.getContentLanguage():formatDate('U', args.from)) or os.time()
}
end
Riga 37:
-------------------------------------------------------------------------------
--
-------------------------------------------------------------------------------
-- Ritorna la differenza in anni, mesi e giorni tra le date d1 e d2 (Unix time).
-- Se rawTable è true ritorna una table con le chiavi: year, month, day, seconds e dir.
local function
local monthdays = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
local ret = { dir = 1, seconds = math.abs(d1 - d2) }
Riga 126:
local diff, ret, dir, val
diff =
magnitudine = magnitudine or getMagnitudine(diff, magnitudine_min)
Riga 161:
end
-- Per utilizzare
function p.
local success, result = xpcall(function() return parseArgs(args) end, errhandler)
return success and
end
Riga 172:
end
-- Entry point per {{#invoke:Data|
function p.
return p.
end
|