模板:Duration:修订间差异
来自星露谷物语扩展百科
更多语言
更多操作
删除的内容 添加的内容
document |
m无编辑摘要 |
||
| 第1行: | 第1行: | ||
<includeonly><templatestyles src="Template:Duration/styles.css" /><span class="durationtemplate{{#ifeq:{{{class|}}}|inline|inline|}}">[[File:Time Icon.png|24px|link=]] |
<includeonly><templatestyles src="Template:Duration/styles.css" /><span class="durationtemplate{{#ifeq:{{{class|}}}|inline|inline|}}">[[File:Time Icon.png|24px|link=]] {{#replace:{{#replace:{{#replace:{{#replace:{{#replace:{{#replace:{{#replace:{{#replace:{{{1|}}}|d|天}}|min|分钟}}|m|分钟}}|h|小时}}|s|秒}}|(|(}}|)|)}}| |}}</span></includeonly><noinclude> |
||
==描述== |
==描述== |
||
该模板用于输出时间,输出时会自动在文本中插入时间的图标:[[File:Time Icon.png|24px]] [[:File:Time Icon.png]]。 |
该模板用于输出时间,输出时会自动在文本中插入时间的图标:[[File:Time Icon.png|24px]] [[:File:Time Icon.png]]。 |
||
| 第51行: | 第51行: | ||
例子: |
例子: |
||
<pre>{{Duration| |
<pre>{{Duration|3d14h15m9s}}</pre> |
||
实际显示效果为: |
实际显示效果为: |
||
{{Duration| |
{{Duration|3d14h15m9s}} |
||
<pre>{{Duration|180m (3h)}}</pre> |
<pre>{{Duration|180m (3h)}}</pre> |
||
2023年4月26日 (三) 20:16的版本
描述
该模板用于输出时间,输出时会自动在文本中插入时间的图标:
File:Time Icon.png。
用法
将下列文本放置在页面中。
{{Duration|时间长度}}
实际显示效果为:
时间长度
禁用自动换行
可插入参数class=inline禁用自动换行。
例子:
正常情况下持续时间为{{Duration|11m 25s|class=inline}},但某些条件下可将时间延长至{{Duration|25m|class=inline}}。
实际显示效果为:
正常情况下持续时间为
11m 25s,但某些条件下可将时间延长至
25m。
中文单位转换
该模板会自动删除所有空格符号。如果给定的文本包括英语的时间单位时,将自动将其转换为对应的中文单位:
| 时间单位 | 自动替换为 |
|---|---|
| d | 天 |
| min | 分钟 |
| m | 分钟 |
| h | 小时 |
| s | 秒 |
| ( | ( |
| ) | ) |
例子:
{{Duration|3d14h15m9s}}
实际显示效果为:
3d14h15m9s
{{Duration|180m (3h)}}
实际显示效果为:
180m (3h)