Template talk:How long ago

This template was based on "Template:User Wikipedian For", which was itself translated from the Hebrew Wikipedia.

Bug in the calculations?
Looking at the doc page today (25 Mar 2011), there's a glitch. A call of returns "6 years and 15 days", but a call of  correctly returns "7 years and 15 days".

I don't see the error, but I know where it is in the code. If those more familiar with the template could take a look, I'd appreciate it. —C.Fred (talk) 16:50, 25 March 2011 (UTC)


 * Looks like I'm not the first to spot this problem. It's been fixed. I suspect the reason it wasn't fixed before now is the utter mess the template code is in. Just a general FYI, there's a much more elegantly written version of this template at Template:For_year_month_day, plus its code is actually readable, and it also recognizes the 100- and 400-year leap-year rules, which this template ignores. --Iritscen (talk) 18:13, 12 June 2013 (UTC)

Formatting bug
An extra space seems to appear between the word ‘and’ and the second number in this template when the amount of time elapsed is exactly a certain number of months after the initial event. For example, using this template today (November 5) for a hypothetical event that occurred on August 5, 2010 yields:
 * (5 years and 3 months; feel free to update it so that the amount of time elapsed is exactly a certain number of months after the day you're editing it on)

I've looked at the code and I don't really understand it, so I'd appreciate it if someone else could fix it. Esszet (talk) 19:31, 5 November 2015 (UTC)


 * I believe I corrected the mistake:
 * I've looked at some sample output of the template and I don't see any cases where there is a missing space before "months", but if anyone sees one, feel free to revert. I had never looked closely at the /exp page before, where the problem was. The markup there is pretty bad too (the indentation and linebreaks do not convey the logic structure at all). --Iritscen (talk) 00:07, 19 November 2015 (UTC)
 * I've looked at some sample output of the template and I don't see any cases where there is a missing space before "months", but if anyone sees one, feel free to revert. I had never looked closely at the /exp page before, where the problem was. The markup there is pretty bad too (the indentation and linebreaks do not convey the logic structure at all). --Iritscen (talk) 00:07, 19 November 2015 (UTC)