Open main menu

Changes

Module:Date

252 bytes added, 10:08, 29 February 2020
fix bug that can occur in {{age}} if attempt to make an invalid yyyy-02-29 date if need to fill month/day from other date
end
if fillmonth or fillday then -- need to create a new date
if (fillmonth or a.month) == 2 and (fillday or a.day) == 29 then
-- Avoid invalid date, for example with {{age|2013|29 Feb 2016}} or {{age|Feb 2013|29 Jan 2015}}.
if not is_leap_year(a.year, a.calendar) then
fillday = 28
end
end
a = Date(a, { month = fillmonth, day = fillday })
end
Anonymous user