|
本館粉絲專頁 |
|
|
使用者:Digipunk/FC/Usage:修訂版本之間的差異
台灣棒球維基館
< 使用者:Digipunk | FC
(新頁面: ==泛用型小日曆(FC)== {| CELLSPACING="12" |- STYLE="vertical-align:top" | <DIV STYLE="width:100%;background:#666;color:white;text-align:center;margin-bottom:4px">{{#timel:Y}} ...) |
小 |
||
第4行: | 第4行: | ||
| | | | ||
<DIV STYLE="width:100%;background:#666;color:white;text-align:center;margin-bottom:4px">{{#timel:Y}} 第{{#switch:{{#expr:ceil({{#timel:n}}/3)}}|1=一|2=二|3=三|4=四}}季</DIV> | <DIV STYLE="width:100%;background:#666;color:white;text-align:center;margin-bottom:4px">{{#timel:Y}} 第{{#switch:{{#expr:ceil({{#timel:n}}/3)}}|1=一|2=二|3=三|4=四}}季</DIV> | ||
− | {{FC|{{#timel:Y}}/{{#expr:ceil({{#timel:n}}/3)*3-2}}|row6=1}} | + | {{{{#if:{{{CALLEE|}}}|{{FULLPAGENAME}}|FC}}|{{#timel:Y}}/{{#expr:ceil({{#timel:n}}/3)*3-2}}|row6=1}} |
− | {{FC|{{#timel:Y}}/{{#expr:ceil({{#timel:n}}/3)*3-1}}|row6=1}} | + | {{{{#if:{{{CALLEE|}}}|{{FULLPAGENAME}}|FC}}|{{#timel:Y}}/{{#expr:ceil({{#timel:n}}/3)*3-1}}|row6=1}} |
− | {{FC|{{#timel:Y}}/{{#expr:ceil({{#timel:n}}/3)*3}}|row6=1}} | + | {{{{#if:{{{CALLEE|}}}|{{FULLPAGENAME}}|FC}}|{{#timel:Y}}/{{#expr:ceil({{#timel:n}}/3)*3}}|row6=1}} |
|} | |} | ||
第125行: | 第125行: | ||
:* 【<B><tt>ymp</tt> 模式</B>】:<tt>"Y/M Pages"</tt> 之意,外觀與預設位置見於此畫面左下角。 | :* 【<B><tt>ymp</tt> 模式</B>】:<tt>"Y/M Pages"</tt> 之意,外觀與預設位置見於此畫面左下角。 | ||
:* 【<B>泛用型模式</B>】:具備標示日期範圍與鏈結的功能。 | :* 【<B>泛用型模式</B>】:具備標示日期範圍與鏈結的功能。 | ||
− | {{FC|ymp=1}} | + | {{{{#if:{{{CALLEE|}}}|{{FULLPAGENAME}}|FC}}|ymp=1}} |
====模式應用與調整==== | ====模式應用與調整==== | ||
第161行: | 第161行: | ||
</PRE> | </PRE> | ||
|- STYLE="vertical-align:top" | |- STYLE="vertical-align:top" | ||
− | | {{FC|2016/1}} | + | | {{{{#if:{{{CALLEE|}}}|{{FULLPAGENAME}}|FC}}|2016/1}} |
− | | {{FC|2016/2}} | + | | {{{{#if:{{{CALLEE|}}}|{{FULLPAGENAME}}|FC}}|2016/2}} |
− | | {{FC|2016/1|row6=1}} | + | | {{{{#if:{{{CALLEE|}}}|{{FULLPAGENAME}}|FC}}|2016/1|row6=1}} |
− | | {{FC|2016/2|row6=1}} | + | | {{{{#if:{{{CALLEE|}}}|{{FULLPAGENAME}}|FC}}|2016/2|row6=1}} |
|} | |} | ||
第211行: | 第211行: | ||
</PRE> | </PRE> | ||
|- STYLE="vertical-align:top" | |- STYLE="vertical-align:top" | ||
− | | {{FC | 2020/2 | + | | {{{{#if:{{{CALLEE|}}}|{{FULLPAGENAME}}|FC}} | 2020/2 |
| from = 2020/02/10 | | from = 2020/02/10 | ||
| to = 2020/02/20 | | to = 2020/02/20 | ||
}} | }} | ||
− | | {{FC | 2020/5 | + | | {{{{#if:{{{CALLEE|}}}|{{FULLPAGENAME}}|FC}} | 2020/5 |
| from = 2020/05/28 | | from = 2020/05/28 | ||
| to = 2020/06/08 | | to = 2020/06/08 | ||
}} | }} | ||
− | | {{FC | 2020/5 | + | | {{{{#if:{{{CALLEE|}}}|{{FULLPAGENAME}}|FC}} | 2020/5 |
| from = 2020/05/28 | | from = 2020/05/28 | ||
| to = 2020/06/08 | | to = 2020/06/08 | ||
| shift = nn | | shift = nn | ||
}} | }} | ||
− | | {{FC | 2020/5 | + | | {{{{#if:{{{CALLEE|}}}|{{FULLPAGENAME}}|FC}} | 2020/5 |
| from = 2020/05/28 | | from = 2020/05/28 | ||
| to = 2020/06/08 | | to = 2020/06/08 | ||
第246行: | 第246行: | ||
====本月的日期鏈結==== | ====本月的日期鏈結==== | ||
− | {{FC | 2020/5 | + | {{{{#if:{{{CALLEE|}}}|{{FULLPAGENAME}}|FC}} | 2020/5 |
| st = float:right | | st = float:right | ||
| from = 2020/05/20 | | from = 2020/05/20 |
2018年9月25日 (二) 17:02的最新修訂版本
目次 |
[編輯] 泛用型小日曆(FC)
2024 第四季
{"pagename":"%E4%BD%BF%E7%94%A8%E8%80%85%3ADigipunk%2FFC%2FUsage","localurl":"%2Fwiki%2Findex.php%3Ftitle%3D","ymp":0,"human":1,"row6":1,"countdown":0,"arg1":"2024%2F10","id":"DGPK-FC","title":"","from":"","to":"","more":"","shift":"","st":{"placeholder":null},"links":{"placeholder":null},"p-links":{"placeholder":null},"n-links":{"placeholder":null}}
{"pagename":"%E4%BD%BF%E7%94%A8%E8%80%85%3ADigipunk%2FFC%2FUsage","localurl":"%2Fwiki%2Findex.php%3Ftitle%3D","ymp":0,"human":1,"row6":1,"countdown":0,"arg1":"2024%2F11","id":"DGPK-FC","title":"","from":"","to":"","more":"","shift":"","st":{"placeholder":null},"links":{"placeholder":null},"p-links":{"placeholder":null},"n-links":{"placeholder":null}}
{"pagename":"%E4%BD%BF%E7%94%A8%E8%80%85%3ADigipunk%2FFC%2FUsage","localurl":"%2Fwiki%2Findex.php%3Ftitle%3D","ymp":0,"human":1,"row6":1,"countdown":0,"arg1":"2024%2F12","id":"DGPK-FC","title":"","from":"","to":"","more":"","shift":"","st":{"placeholder":null},"links":{"placeholder":null},"p-links":{"placeholder":null},"n-links":{"placeholder":null}}
|
[編輯] 語法
1 | {{FC | |
2 | <!-- 所有參數皆具備預設值(可省略) --> | |
3 | <!-- 【順序參數】 --> | |
4 | | 1 | = <年月。格式:YYYY/MM。預設值:目前年月> |
5 | ||
6 | <!-- 【具名參數】 --> | |
7 | | title | = <小日曆標題> |
8 | | row6 | = <設為 1 表示強制顯示第六列。預設值是有第六列才顯示> |
9 | | ymp | = <設為 1 表示 YMP 模式,即出現於「月份頁面」的形式> |
10 | | from | = <標示起始日期。格式:YYYY/MM/DD> |
11 | | to | = <標示結束日期。格式:YYYY/MM/DD> |
12 | | shift | = <向上或向下平移一或兩列。合法值:p、pp、n、nn> |
13 | | more | = <向上或向下增加一或兩列。合法值:p、pp、pn、np、n、nn> |
14 | ||
15 | | link-<day> | = <設定此月份第 <day> 日的鏈結> |
16 | | p-link-<day> | = <設定前一月份第 <day> 日的鏈結> |
17 | | n-link-<day> | = <設定後一月份第 <day> 日的鏈結> |
18 | ||
19 | <!-- 【樣式設定】 --> | |
20 | | st | = <整體樣式> |
21 | | st-header | = <標題列樣式> |
22 | | st-wday | = <星期列樣式> |
23 | | st-day | = <日期框格樣式> |
24 | | st-day-pn | = <前後月日期框格樣式> |
25 | | st-today | = <今日樣式> |
26 | | st-link | = <日期鏈結樣式> |
27 | | st-link-pn | = <前後月日期鏈結樣式> |
28 | | st-mark | = <日期標示樣式> |
29 | | st-mark-pn | = <前後月日期標示樣式> |
30 | ||
31 | | human | = <人類作息模式,每週從星期一開始。預設值 1> |
32 | | countdown | = <日數倒數> |
33 | | st-countdown | = <日數倒數樣式> |
34 | }} |
[編輯] 說明
- 此為 JavaScript 版的小日曆,在網頁載入後才會產生。
- 前端參數用法、效果與【第一版】完全相同。
[編輯] 應用
[編輯] 要顯示哪一個月
- 如果有指定年月,便優先使用指定的年月,即此模板的第一個順序參數,例如:{{FC|2020/8}}
- 如果未指定年月,則:
- 如果此模板被「月份頁面」所呼叫,則自動取用該頁面標題裡的年月,並自動設定參數 ymp=1。
- 如果此模板位於「月份頁面」以外的任何頁面,便顯示目前年月。
[編輯] 兩種模式
- 【ymp 模式】:"Y/M Pages" 之意,外觀與預設位置見於此畫面左下角。
- 【泛用型模式】:具備標示日期範圍與鏈結的功能。
{"pagename":"%E4%BD%BF%E7%94%A8%E8%80%85%3ADigipunk%2FFC%2FUsage","localurl":"%2Fwiki%2Findex.php%3Ftitle%3D","ymp":1,"human":1,"row6":0,"countdown":0,"arg1":"","id":"DGPK-FC","title":"","from":"","to":"","more":"","shift":"","st":{"placeholder":null},"links":{"placeholder":null},"p-links":{"placeholder":null},"n-links":{"placeholder":null}}
[編輯] 模式應用與調整
- 在「月份頁面」不加任何參數,便是 ymp 模式。
如果在其它頁面想使用 ymp 模式,設定參數 ymp=1 即可顯示這個浮動式小日曆,並使其中的日期鏈結至「月份頁面」。 - 在「月份頁面」以外使用此模板,預設為泛用型模式。如果任性要在「月份頁面」裡使用泛用型模式,只要設定 ymp=0 即可。
- 如果頭殼不正常,想要在「A年/B月」頁面顯示「X年/Y月」的小日曆,則依此模板之特性,指定欲顯示的年月即可。
- 在「月份頁面」不加任何參數,便是 ymp 模式。
[編輯] 第六列
- 因每月的日數及起始日之不同,日曆會以四列至六列的形式呈現。但某些時候為顧及版面問題,希望高度一致,可設定參數 row6=1 強制顯示第六列。
預設值(row6=0),未必有第六列 強制顯示第六列(row6=1) {{FC | 2016/1}}
{{FC | 2016/2}}
{{FC | 2016/1|row6=1}}
{{FC | 2016/2|row6=1}}
{"pagename":"%E4%BD%BF%E7%94%A8%E8%80%85%3ADigipunk%2FFC%2FUsage","localurl":"%2Fwiki%2Findex.php%3Ftitle%3D","ymp":0,"human":1,"row6":0,"countdown":0,"arg1":"2016%2F1","id":"DGPK-FC","title":"","from":"","to":"","more":"","shift":"","st":{"placeholder":null},"links":{"placeholder":null},"p-links":{"placeholder":null},"n-links":{"placeholder":null}}{"pagename":"%E4%BD%BF%E7%94%A8%E8%80%85%3ADigipunk%2FFC%2FUsage","localurl":"%2Fwiki%2Findex.php%3Ftitle%3D","ymp":0,"human":1,"row6":0,"countdown":0,"arg1":"2016%2F2","id":"DGPK-FC","title":"","from":"","to":"","more":"","shift":"","st":{"placeholder":null},"links":{"placeholder":null},"p-links":{"placeholder":null},"n-links":{"placeholder":null}}{"pagename":"%E4%BD%BF%E7%94%A8%E8%80%85%3ADigipunk%2FFC%2FUsage","localurl":"%2Fwiki%2Findex.php%3Ftitle%3D","ymp":0,"human":1,"row6":1,"countdown":0,"arg1":"2016%2F1","id":"DGPK-FC","title":"","from":"","to":"","more":"","shift":"","st":{"placeholder":null},"links":{"placeholder":null},"p-links":{"placeholder":null},"n-links":{"placeholder":null}}{"pagename":"%E4%BD%BF%E7%94%A8%E8%80%85%3ADigipunk%2FFC%2FUsage","localurl":"%2Fwiki%2Findex.php%3Ftitle%3D","ymp":0,"human":1,"row6":1,"countdown":0,"arg1":"2016%2F2","id":"DGPK-FC","title":"","from":"","to":"","more":"","shift":"","st":{"placeholder":null},"links":{"placeholder":null},"p-links":{"placeholder":null},"n-links":{"placeholder":null}}
[編輯] 標示日期範圍
- 兩個參數,顧名思義:from 與 to,格式為 YYYY/MM/DD(月日數字有無前綴 "0" 無所謂)。
- 此功用適用於表示賽事日期,或任何需註明日期的事件,例如 Good Boy 國軍 online 數饅頭的日子。
(Ⅰ) 2020年2/10~2/20 (Ⅱ) 2020年5/28~6/8 (Ⅲ) 2020年5/28~6/8 下移兩週 (Ⅳ) 2020年5/28~6/8 下加兩週 {{FC | 2020/2 | from = 2020/02/10 | to = 2020/02/20 }}
{{FC | 2020/5 | from = 2020/05/28 | to = 2020/06/08 }}
{{FC | 2020/5 | from = 2020/05/28 | to = 2020/06/08 | shift = nn }}
{{FC | 2020/5 | from = 2020/05/28 | to = 2020/06/08 | more = nn }}
{"pagename":"%E4%BD%BF%E7%94%A8%E8%80%85%3ADigipunk%2FFC%2FUsage","localurl":"%2Fwiki%2Findex.php%3Ftitle%3D","ymp":0,"human":1,"row6":0,"countdown":0,"arg1":"2020%2F2","id":"DGPK-FC","title":"","from":"2020%2F02%2F10","to":"2020%2F02%2F20","more":"","shift":"","st":{"placeholder":null},"links":{"placeholder":null},"p-links":{"placeholder":null},"n-links":{"placeholder":null}}{"pagename":"%E4%BD%BF%E7%94%A8%E8%80%85%3ADigipunk%2FFC%2FUsage","localurl":"%2Fwiki%2Findex.php%3Ftitle%3D","ymp":0,"human":1,"row6":0,"countdown":0,"arg1":"2020%2F5","id":"DGPK-FC","title":"","from":"2020%2F05%2F28","to":"2020%2F06%2F08","more":"","shift":"","st":{"placeholder":null},"links":{"placeholder":null},"p-links":{"placeholder":null},"n-links":{"placeholder":null}}{"pagename":"%E4%BD%BF%E7%94%A8%E8%80%85%3ADigipunk%2FFC%2FUsage","localurl":"%2Fwiki%2Findex.php%3Ftitle%3D","ymp":0,"human":1,"row6":0,"countdown":0,"arg1":"2020%2F5","id":"DGPK-FC","title":"","from":"2020%2F05%2F28","to":"2020%2F06%2F08","more":"","shift":"nn","st":{"placeholder":null},"links":{"placeholder":null},"p-links":{"placeholder":null},"n-links":{"placeholder":null}}{"pagename":"%E4%BD%BF%E7%94%A8%E8%80%85%3ADigipunk%2FFC%2FUsage","localurl":"%2Fwiki%2Findex.php%3Ftitle%3D","ymp":0,"human":1,"row6":0,"countdown":0,"arg1":"2020%2F5","id":"DGPK-FC","title":"","from":"2020%2F05%2F28","to":"2020%2F06%2F08","more":"nn","shift":"","st":{"placeholder":null},"links":{"placeholder":null},"p-links":{"placeholder":null},"n-links":{"placeholder":null}}
[編輯] 跨月問題及解法
- 如 (Ⅱ) 所示,跨月後,標示的日期將被截斷,因為小日曆是以單一一個月為基準,沒辦法顯示過長的日期。
- 對於短期賽事,這不是大問題,可利用 (Ⅲ) 的方法前後移動顯示窗口,或以 (Ⅳ) 的方法往前後擴展,見底下段落說明。
- 對於時間較長的賽事,先考量適不適合用小日曆顯示,並非所有情況都合宜;當然更簡單的解法是看有幾個月,就連續用幾個小日曆,既明確又無煩惱。
[編輯] 兩個字母
- 使用此模板時,要記住兩個字母:
- p = previous,在此代表前面的月或週。
- n = next,在此用於表示後面的月或週。
[編輯] 加上日期鏈結
[編輯] 本月的日期鏈結
{"pagename":"%E4%BD%BF%E7%94%A8%E8%80%85%3ADigipunk%2FFC%2FUsage","localurl":"%2Fwiki%2Findex.php%3Ftitle%3D","ymp":0,"human":1,"row6":0,"countdown":0,"arg1":"2020%2F5","id":"DGPK-FC","title":"","from":"2020%2F05%2F20","to":"2020%2F05%2F24","more":"","shift":"","st":{"placeholder":null,"div":"float%3Aright"},"links":{"placeholder":null,"11":"%E9%A6%96%E9%A0%81","12":"%E9%A6%96%E9%A0%81","13":"%E9%A6%96%E9%A0%81"},"p-links":{"placeholder":null},"n-links":{"placeholder":null}}
| link-<day> = <頁面名稱> <!-- 其中 <day> 為 0..31,即該月的日期 -->
[編輯] 前一個月的日期鏈結
| p-link-<day> = <頁面名稱> <!-- 其中 <day> 為 11..31,即前一個月裡的日期 -->
[編輯] 後一個月的日期鏈結
| n-link-<day> = <頁面名稱> <!-- 其中 <day> 為 1..20,即後一個月裡的日期 -->
[編輯] 前後移動一或兩週
- 首先觀察指定月份的日期分佈,有時候只要加 row6=1 就能處理跨月的標記問題。
- 接下來將此月份的外框當作一個窗口,決定讓它向上或向下移動。
- 參數 shift,合法值:
- p,上移一週。
- pp,上移兩週。
- n,下移一週。
- nn,下移兩週。
- 目前只能移動兩週的距離,因為我覺得需移動三週以上的話...那指定前一個月或下個月不就好了。
[編輯] 範例
- 見「標示日期範圍」的 (Ⅱ)、(Ⅲ)、(Ⅳ)。
[編輯] 前後增加一或兩週
- 首先觀察指定月份的日期分佈,有時候只要加 row6=1 就能處理跨月的標記問題。
- 接下來以指定月份為基準,決定讓它向上或向下擴展幾週。
- 參數 more,合法值:
- p,往前加一週。
- pp,往前加兩週。
- np 或 pn,前後各加一週。
- n,往後加一週。
- nn,往後加兩週。
- 不能超過兩週,理由同上段所述。
[編輯] 範例
- 見「標示日期範圍」的 (Ⅱ)、(Ⅲ)、(Ⅳ)。