Module:Date Stuff: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 16: Line 16:
local orgiArgs = frame.args
local orgiArgs = frame.args
local args = {}
local args = {}
if firstDate == "{{{1}}}" or secondDate == "{{{2}}}" then
return nil
end
for k, v in pairs(orgiArgs) do
for k, v in pairs(orgiArgs) do
v = v:match('^%s*(.-)%s*$')
v = v:match('^%s*(.-)%s*$')
Line 87: Line 90:
   calendar = args[4]
   calendar = args[4]
   --checks if firstDate is not nil, and if it is returns the second date
   --checks if firstDate is not nil, and if it is returns the second date
   if secondDate then
   if firstDate ~= nil then
  return secondDate
  elseif firstDate == nil and secondDate == nil then
  return nil
  elseif firstDate ~= nil then
     firstDate = convertShortDate(firstDate, calendar)
     firstDate = convertShortDate(firstDate, calendar)
     secondDate = convertShortDate(secondDate, calendar)
     secondDate = convertShortDate(secondDate, calendar)