テンプレート:is-leap-year

提供: Yourpedia
移動: 案内検索

指定した西暦年が閏年ならば1を、平年ならば0を返す。

第1引数で年数を指定する。

第2引数で暦を指定する。0ならばユリウス暦、1ならばグレゴリオ暦として計算する。

使用例[編集]

  • {{is-leap-year|645|0}} = {{#expr:645 mod 4 = 0 and (0=0 or (645 mod 100 <> 0 or 645 mod 400 = 0))}}
  • {{is-leap-year|652|0}} = {{#expr:652 mod 4 = 0 and (0=0 or (652 mod 100 <> 0 or 652 mod 400 = 0))}}
  • {{is-leap-year|1600|1}} = {{#expr:1600 mod 4 = 0 and (1=0 or (1600 mod 100 <> 0 or 1600 mod 400 = 0))}}
  • {{is-leap-year|1601|1}} = {{#expr:1601 mod 4 = 0 and (1=0 or (1601 mod 100 <> 0 or 1601 mod 400 = 0))}}
  • {{is-leap-year|1604|1}} = {{#expr:1604 mod 4 = 0 and (1=0 or (1604 mod 100 <> 0 or 1604 mod 400 = 0))}}
  • {{is-leap-year|1700|1}} = {{#expr:1700 mod 4 = 0 and (1=0 or (1700 mod 100 <> 0 or 1700 mod 400 = 0))}}
  • {{is-leap-year|1800|1}} = {{#expr:1800 mod 4 = 0 and (1=0 or (1800 mod 100 <> 0 or 1800 mod 400 = 0))}}
  • {{is-leap-year|1900|1}} = {{#expr:1900 mod 4 = 0 and (1=0 or (1900 mod 100 <> 0 or 1900 mod 400 = 0))}}
  • {{is-leap-year|2000|1}} = {{#expr:2000 mod 4 = 0 and (1=0 or (2000 mod 100 <> 0 or 2000 mod 400 = 0))}}