Module:Complex date/sandbox: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
 
Line 398:
state.units1 = string.lower(units1 or '')
state.units2 = string.lower(units2 or '')
 
-- if date 1 is missing but date 2 is provided than swap them
if date1 == '' and date2 ~= '' then
Line 406:
adj2 = '', era2 = '', units2 = '', conj=state.conj, num=1}
end
if date2 ~= '' then state.nDates = 2
elseif date1 ~= '' then state.nDates = 1
else state.nDates = 0
end
 
-- reconcile alternative names for text inputs
local conj = checkAliases(state.conj ,'' ,'j')
Line 425:
return nil
end
 
-- calculate date precision value
date1, state.units1, state.precision1 = datePrecision(date1, state.units1)
Line 545:
function p.complex_date(frame)
-- process inputs
local dateStr, Error
local args = frame.args
if not (args.lang and mw.language.isSupportedLanguage(args.lang)) then