Module:DateThings: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
 
(13 intermediate revisions by the same user not shown)
Line 17: Line 17:
end
end
      
      
function p.datesplit(frame)
function p.datesplitsuccinct(frame)
InputSeparator = ","
InputSeparator = ","
OutputSeparator = "・"
OutputSeparator = "・"
Line 39: Line 39:
Day = DateBits[3]
Day = DateBits[3]
ThisDate = os.date({ year = Year, month = Month, day = Day })
ThisDate = os.time{ year = Year, month = Month, day = Day }
tempdate = os.date ("*t", ThisDate)
Day = tempdate.day
--OutputText = OutputText .. trim(DateList[i])
--OutputText = OutputText .. trim(DateList[i])
Line 46: Line 49:
if Year==OldYear then
if Year==OldYear then
if Month==OldMonth then
if Month==OldMonth then
OutputText = OutputText .. Day --Only the day is different
OutputText = OutputText .. os.date("[[%B ", ThisDate) .. Day .. "|" .. Day .. "]]" --Only the day is different
else
else
OutputText = OutputText .. Month .. "-" .. Day --Day and month are different
OutputText = OutputText .. os.date("[[%B ", ThisDate) .. Day .. "]]" --Day and month are different
end
end
else
else
--OutputText = OutputText .. Year .. "-" .. Month .. "-" .. Day --All three are different
OutputText = OutputText .. os.date("[[%Y]] [[%B ", ThisDate) .. Day .. "]]" --All three are different
OutputText = OutputText .. ThisDate
end
end

Navigation menu