Template talk:Datediff
From Guild Wars Wiki
Jump to navigationJump to search
year/month/days template?[edit]
Is there any way that a template could be made that would change the current datediff template to display the days in years/months/days instead of one large day number? Look on my character's pages to see what I'm meaning, my warrior is said to be an age of 900+ days. Is there a way to change this by template that'll automatically update itself? —The preceding unsigned comment was added by Neithan Diniem (talk • contribs) at 17:23, 1 February 2009 (UTC).
- Sorry about unsigned >_< forgot...Neithan Diniem 18:14, 1 February 2009 (UTC)
- Don't worry forgetting to sign. We all do that once in a while.
- As for the output, it's meant to output as one big number as it's mainly used to track the number of days that has passed since treasure hunting :) Proper date calculation will require a bit more work and will be much easier to create by using additional templates that attempt to break down the value returned by this template. -- ab.er.rant 14:33, 2 February 2009 (UTC)
- Is there any particular templates you have in mind? this question was asked by someone who isn't all too savvy with advanced wikicode and complex template creation/interface.Neithan Diniem 22:08, 2 February 2009 (UTC)
- I whipped up something for you. For your characters, use {{Age}} instead {{Datediff}}. It just shows years and days based on the date diff. -- ab.er.rant 09:41, 3 February 2009 (UTC)
- I was looking at doing this last night too, but it seems you ran into the same problem (or tried to bypass it) that I did. Yours doesn't configure in leap year or months/weeks (which is damn near impossible without a rather large template) I will look more into it later if I think of a better way to handle it. I don't like the fact that
this{{age}} will show a max of 364 days, which is the same as datediff if the diff is less than a year. — Rappy 22:38, 3 February 2009 (UTC)
- I was looking at doing this last night too, but it seems you ran into the same problem (or tried to bypass it) that I did. Yours doesn't configure in leap year or months/weeks (which is damn near impossible without a rather large template) I will look more into it later if I think of a better way to handle it. I don't like the fact that
- I whipped up something for you. For your characters, use {{Age}} instead {{Datediff}}. It just shows years and days based on the date diff. -- ab.er.rant 09:41, 3 February 2009 (UTC)
- Well this will work for me, it will let me actually place a good, well organized age date than just ~3 years or 900+ days, Thanks for whipping this up! Neithan Diniem 22:42, 3 February 2009 (UTC)
- Well, found an oddity, I may be doing this wrong, but the Age template is displaying an incorrect date, Am I doing it wrong? I have it on my war as {{Age|1 Aug 2006}} and its saying its over 3 years 180 days, when my character is only 30 months old (2 years, 180 days), so its a year off? --The preceding unsigned comment was added by User:Neithan Diniem (talk).
- That's because the round 0 is rounding 2.5 up to 3, and it seems our parcer here doesn't allow trunc or floor options, so there's no way around that currently. — Rappy 23:24, 3 February 2009 (UTC)
- Well, found an oddity, I may be doing this wrong, but the Age template is displaying an incorrect date, Am I doing it wrong? I have it on my war as {{Age|1 Aug 2006}} and its saying its over 3 years 180 days, when my character is only 30 months old (2 years, 180 days), so its a year off? --The preceding unsigned comment was added by User:Neithan Diniem (talk).
- Well this will work for me, it will let me actually place a good, well organized age date than just ~3 years or 900+ days, Thanks for whipping this up! Neithan Diniem 22:42, 3 February 2009 (UTC)