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