Module:Date: Difference between revisions
replace kludge using global set_current_for_test so Module:No globals can be used by a module requiring Module:Date
(update from Module:Date/sandbox; major refactor to support new features in Module:Age) |
(replace kludge using global set_current_for_test so Module:No globals can be used by a module requiring Module:Date) |
||
Line 696: | Line 696: | ||
-- A table to get the current date/time (UTC), but only if needed. | -- A table to get the current date/time (UTC), but only if needed. | ||
local current = setmetatable({}, { | |||
local current = setmetatable( | |||
__index = function (self, key) | __index = function (self, key) | ||
local d = os.date('!*t') | local d = os.date('!*t') |