跳转到内容

模板:Timer

来自DJMAX中文资料库
MJ Hamster留言 | 贡献2025年10月5日 (日) 17:19的版本

显示一个倒计时。

变量

  • time[1] : 一个时间,必要。
  • countup : 布尔值。如果设定时间已过,则正数计时。会覆盖class & [2]的效果。
  • short : 布尔值。时间显示为字母样式,如“天”显示“d”。
  • class : 当同一页面有多个计时器时区别使用。比如,第一个计时器默认为 countdownComplete1,第二个计时器为countdownComplete2,等等。
    • [2] : 可以是任何一个数字,比如 2 是第二个计时器。
  • text : 可选文本,默认为 计时结束 。在 countup 计时结束后使用。
  • style : 自定义格式,可选。
  • extra_style : 默认风格之外的其他CSS格式,可选。

JS补充细节请参考MediaWiki:Gadget-Countdown.js

示例

{{Timer|January 1 2023 00:00:00 +0900|extra_style = text-align:left}}

{{Timer|January 1 2030 00:00:00 +0900|2|style = font-style:italic|text = Not yet.}}

{{Timer|January 19 2038 12:14:07 +0900|3|style = font-weight:bold|text = The time is now!}}

{{Timer|January 29 2042 12:17:04 +0900|3|style = font-weight:bold|short=true|text = The time is now short!}}

countup 示例

{{Timer|January 1 2020 00:00:00 +0900|countup=true|extra_style = text-align:left}}

{{Timer|January 1 1980 00:00:00 +0900|countup=true|style = font-style:italic|text = ago}}

{{Timer|January 1 1970 00:00:00 +0900|countup=true|style = font-weight:bold|short=true|text = in the past}}

{{Timer|January 19 2038 12:14:07 +0900|countup=true|style = font-weight:bold|text =. Still counts down normally for future dates.}}