Template talk:Age in days

From Wikipedia, the free encyclopedia

Template:Age in days is permanently protected from editing, as it is a heavily used or visible template.

Substantial changes should be proposed here, and made by administrators if the proposal is uncontroversial, or has been discussed and is supported by consensus. Use {{editprotected}} to attract the attention of an administrator in such cases.
Any contributor may edit the template's documentation to add usage notes, categories or interwiki links.

Contents

[edit] Examples

{{age in days|month1=1|day1=1|year1=2006}} gives 895

{{age in days|2006|1|1}} gives 895 [1]Template:Xpd/

[edit] Used

This is a useful template that should get more wider use. It is especially useful for lists counting title reigns. Alex43223 Talk | Contribs | E-mail | C 00:34, 28 February 2007 (UTC)

[edit] Leap days?

Does it count leap days and other such calendar mysteries? --Brandon Dilbeck 01:47, 15 March 2007 (UTC)

Yes. It should uses the Template:Gregorian serial date which should that into account (according to that template-page). /AB-me (chit-chat) 17:32, 19 March 2007 (UTC)
Okay. Phew. --Brandon Dilbeck 19:23, 19 March 2007 (UTC)

[edit] Sandbox

These two examples fail, because they do not name their arguments:

  • March 21, 2007 was 729861 days ago.
  • May 24, 2007 was 729039 days ago.

Try again with argument names:

  • March 21, 2007 was 451 days ago.
  • May 24, 2007 was 387 days ago.

[edit] Arguments

Why does this template even ask for arguments? Other similar templates like {{age}} do not. --Arctic Gnome (talkcontribs) 21:28, 7 August 2007 (UTC)

You mean argument names? I added the option of using unnamed parameters:

  • {{age in days|2007|3|21}} gives 451 [2]Template:Xpd/
  • {{age in days|2007|5|24}} gives 387 [3]Template:Xpd/
  • {{age in days|2007|5|24|2008|4|23}} gives 335

Patrick 13:40, 18 August 2007 (UTC)

[edit] Interwiki

Please add [[de:Vorlage:Tagesdifferenz]].--Tilla2501 12:55, 18 August 2007 (UTC)

[edit] IW

Please add no:Mal:Alder i dager. Nsaa 21:14, 26 September 2007 (UTC)

[edit] Seperators

Could the template be modified to insert seperators into a search outcome (eg 3,258 rather than 3258)? --GW_SimulationsUser Page | Talk 15:41, 22 October 2007 (UTC)

[edit] Documentation

{{editprotected}}
Please use {{documentation}}. 16@r (talk) 03:02, 29 January 2008 (UTC)

Y Done - Nihiltres{t.l} 19:09, 30 January 2008 (UTC)

[edit] Make this sort better

Can any template-writers figure this puzzle out for me? In sortable tables, numbers will sometimes be sorted by digit rather than by number, making it look like 20 is bigger than 100. I want to make this template add an invisible zero using the template {{0}} to the beginning of two-digit numbers, and two invisible zeros to the beginning of one digit numbers. In practise this fixes the sortable tables, but making it work with this template would take me quite a while of figuring. I think it can be done by coding that if RESULT is < 10, then print "{{0}}{{0}}RESULT" and if RESULT is < 100 then print "{{0}}RESULT". Another option to make it work with the tables is to somehow incorporate the template {{nts}} into it. Thanks --Arctic Gnome (talkcontribs) 05:36, 20 March 2008 (UTC)

In sandbox testing, just enclosing this template in {{nts}} seems to work. I was expecting (knock on wood) it to be much more complicated. --Arctic Gnome (talkcontribs) 05:52, 20 March 2008 (UTC)