本館粉絲專頁

使用者:Digipunk/FC2

分享此網頁到Facebook
分享此網頁到Plurk
分享此網頁到百度搜藏
分享此網頁到Twitter
分享此網頁到Del.icio.us
最近作者:Digipunk 2018年9月25日 (星期二)17:00
台灣棒球維基館
跳轉到: 導覽搜尋

目次

[編輯] 泛用型小日曆(FC)

2019 第三季
{"pagename":"%E4%BD%BF%E7%94%A8%E8%80%85%3ADigipunk%2FFC2","localurl":"%2Fwiki%2Findex.php%2F","ymp":0,"human":1,"row6":1,"countdown":0,"arg1":"2019%2F7","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%2FFC2","localurl":"%2Fwiki%2Findex.php%2F","ymp":0,"human":1,"row6":1,"countdown":0,"arg1":"2019%2F8","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%2FFC2","localurl":"%2Fwiki%2Findex.php%2F","ymp":0,"human":1,"row6":1,"countdown":0,"arg1":"2019%2F9","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%2FFC2","localurl":"%2Fwiki%2Findex.php%2F","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月」的小日曆,則依此模板之特性,指定欲顯示的年月即可。

[編輯] 第六列

  • 因每月的日數及起始日之不同,日曆會以四列至六列的形式呈現。但某些時候為顧及版面問題,希望高度一致,可設定參數 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%2FFC2","localurl":"%2Fwiki%2Findex.php%2F","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%2FFC2","localurl":"%2Fwiki%2Findex.php%2F","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%2FFC2","localurl":"%2Fwiki%2Findex.php%2F","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%2FFC2","localurl":"%2Fwiki%2Findex.php%2F","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}}

[編輯] 標示日期範圍

  • 兩個參數,顧名思義:fromto,格式為 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%2FFC2","localurl":"%2Fwiki%2Findex.php%2F","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%2FFC2","localurl":"%2Fwiki%2Findex.php%2F","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%2FFC2","localurl":"%2Fwiki%2Findex.php%2F","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%2FFC2","localurl":"%2Fwiki%2Findex.php%2F","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%2FFC2","localurl":"%2Fwiki%2Findex.php%2F","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,往前加兩週。
  • nppn,前後各加一週。
  • n,往後加一週。
  • nn,往後加兩週。
不能超過兩週,理由同上段所述。

[編輯] 範例

[編輯] 開發記錄

  • [2018-07-25] 改以 JavaScript 在頁面載入後才輸出。