Module:Time/sandbox: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 302:
end
local tz_datadata = table.concat ({'Module:Time/data', frame:getTitle():find('sandbox', 1, true) and '/sandbox' or ''}); -- make a data module name; sandbox or live
tz_datadata = mw.loadData (tz_datadata).tz_data; -- load the data table module
local cfg = data.cfg; -- get the configuration table
local tz_data = data.tz_data; -- get the tz data table
 
if args[1] then
Line 328 ⟶ 330:
end
 
local df_vals = {['dmy']=true, ['dmy12']=true, ['dow']=true, ['mdy']=true, ['mdy12']=true, ['iso']=true, ['y']=true, ['12']=true, ['24']=true}; -- TODO: move this table to /data
df = args.df or args[2] or tz.df or 'mdy'; -- template |df= overrides typical df from tz properties
df = df:lower(); -- normalize to lower case
if not cfg.df_vals[df] then
return '<span style="font-size:100%" class="error">{{time}} – invalid date format ([[Template:Time#Error messages|help]])</span>';
end