View source for Module:Ancient Egypt era
MyWikiBiz, Author Your Legacy — Saturday May 17, 2025
Jump to navigationJump to searchYou do not have permission to edit this page, for the following reasons:
You can view and copy the source of this page.
local data = mw.loadData( 'Module:Ancient Egypt era/data' )
local lang = mw.language.getContentLanguage()
local p = {}
function p._main( inputYear )
-- Convert the input to an integer if possible. Return "N/A" if the input could
-- not be converted, or if the converted input is too big or too small.
inputYear = tonumber( inputYear )
if not inputYear or inputYear > tonumber( lang:formatDate( 'Y' ) ) then
return "''N/A''"
end
-- Find the length of the data.
-- We need the length of the data so that we can loop through it backwards.
-- Normally we can get the length of tables with the # operator, but this
-- doesn't work with mw.loadData, as mw.loadData uses a metatable, and the
-- # operator doesn't work for tables that use metatables.
local dataLength = 0
for i, t in ipairs( data ) do
dataLength = i
000
1:0
Template used on this page:
Return to Module:Ancient Egypt era.