Module:Time/sandbox: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 1:
require ('Module:No globals')
local getArgs = require ('Module:Arguments').getArgs
local tz = {}; -- holds local copy of the specified timezone table from tz_data{}
local cfg = {}; -- for internationalization
 
--[[-------------------------< S E T _ S A N D B O X >--------------------------------------------------------
Line 26 ⟶ 24:
end
 
---------------------------------------------------------------------------------------------------------------
 
local tz = {}; -- holds local copy of the specified timezone table from tz_data{}
local data = 'Module:Time/data'..set_sandbox(frame) -- make a data module name; sandbox or live
local data = mw.loadData (data); -- load the data module
local cfg = {}data.cfg; -- forget the internationalizationconfiguration table
 
--[[--------------------------< I S _ S E T >------------------------------------------------------------------
Line 233 ⟶ 238:
dst_end = dst_end - utc_offset; -- adjust local time to utc by subtracting utc offset
end
 
 
if dst_b_month > dst_e_month then
Line 355 ⟶ 359:
end
 
--[=[-------------------------< D S T _ A C T I V E >---------------------------------------------------------
local function dst_active (frame) -- call from #invoke
 
#invoke version of is_dst_active
 
]=]
 
local function dst_active (frame) -- call from #invoke
local args = getArgs (frame);
return _dst_activeis_dst_active (argstimestamp,utc_timestamp)
end
 
Line 385 ⟶ 395:
local DF; -- date format flag; the |df= parameter
local is_dst; -- wether or not dst is active
local data = 'Module:Time/data'..set_sandbox(frame) -- make a data module name; sandbox or live
data = mw.loadData (data); -- load the data module
cfg = data.cfg; -- get the configuration table
local formats = data.formats;
local tz_aliases = {}
Line 521 ⟶ 528:
return time_string..tz_tag..refresh_link
 
end