Module:Time/sandbox: Difference between revisions

Content deleted Content added
m sync with live version Special:Permalink/907957873
use Module:Yesno for booleans instead of string comparisons
Line 1:
require ('Module:No globals')
local yesno = require('Module:Yesno')
local getArgs = require ('Module:Arguments').getArgs
 
Line 358 ⟶ 359:
local tz_data = data.tz_data; -- get the tz data table
 
local Timeonly = 'yes' == yesno(first_set (cfg.aliases['timeonly'], args)); -- boolean
local Dateonly = 'yes' == yesno(first_set (cfg.aliases['dateonly'], args)); -- boolean
if Timeonly and Dateonly then -- invalid condition when both are set
Timeonly, Dateonly = false;
end
local Hide_refresh = 'yes' == yesno(first_set (cfg.aliases['hide-refresh'], args)); -- boolean
local Hide_tz = 'yes' == yesno(first_set (cfg.aliases['hide-tz'], args)); -- boolean
local Unlink_tz = 'yes' == yesno(first_set (cfg.aliases['unlink-tz'], args)); -- boolean
local DST = first_set (cfg.aliases['dst'], args);