テンプレートの解説[表示] [編集] [履歴] [キャッシュを破棄]

このテンプレートは非常に複雑な計算式を用いており、記事内の多数の場所で使用されています。変更する際はサンドボックスで充分なテストを実施後に変更の適用をお願いします。

これは何? 編集

2つの指定された年月日を比較して年月を割り出すテンプレート。

2つめの年月日パラメータが省略された場合、現在までの日数と比較する。

toパラメータで以下の接続詞の切り替えが出来る。省略(デフォルト)は「 + 」
  • to=to - ○年と☓日
  • to=none - ○年☓日
  • 省略 - ○年 + ☓日
ageパラメータで以下の接尾詞の切り替えが出来る。省略(デフォルト)は「年」
  • age=yes - ○歳 + ☓日
  • age=no - ○年 + ☓日
  • 省略 - ○年 + ☓日

使い方 編集

  • {{age in years and days|year1|month1|day1|year2|month2|day2|to=to}}
  • {{age in years and days|year1|month1|day1|to=none}}
  • {{age in years and days|year1|month1|day1}}

編集

  • {{age in years and days|1989|12|28|2015|8|14}}
    • 25年 + 229日
  • {{age in years and days|1989|12|28}}
    • 34年 + 114日
  • {{age in years and days|1989|12|28|1990|12|29|to=to}}
    • 1年と1日
  • {{age in years and days|1989|12|28|1990|12|29|to=none}}
    • 1年1日
  • {{age in years and days|1989|12|28|2015|8|14|age=yes}}
    • 25歳 + 229日
  • {{age in years and days|{{subst:CURRENTYEAR}}|{{subst:CURRENTMONTH}}|{{subst:CURRENTDAY2}}|to=to}}
    • subst展開で日付を入力している為、貼り付けてから、どれだけ経過したかが分かります。
尚、この例が追加されてから、n年とn日が経過しています。