檢視 模块:Citation/CS1/Date validation 的原始碼
由於下列原因,您沒有權限進行 編輯此頁面 的動作:
您可以檢視並複製此頁面的原始碼。
local p = {}
--[[--------------------------< I S _ V A L I D _ A C C E S S D A T E >----------------------------------------
returns true if:
Wikipedia start date <= accessdate < today + 2 days
Wikipedia start date is 2001-01-15T00:00:00 UTC which is 979516800 seconds after 1970-01-01T00:00:00 UTC (the start of Unix time)
accessdate is the date provided in |accessdate= at time 00:00:00 UTC
today is the current date at time 00:00:00 UTC plus 48 hours
if today is 2015-01-01T00:00:00 then
adding 24 hours gives 2015-01-02T00:00:00 – one second more than today
adding 24 hours gives 2015-01-03T00:00:00 – one second more than tomorrow
]]
local function is_valid_accessdate (accessdate)
local lang = mw.getContentLanguage();
local good1, good2;
local access_ts, tomorrow_ts; -- to hold unix time stamps representing the dates
000
1:0
此頁面使用了以下模板:
- Template:Module rating(檢視原始碼)
- Template:Ombox(檢視原始碼)
- 模块:Arguments(檢視原始碼)
- 模块:Category handler(檢視原始碼)
- 模块:Category handler/blacklist(檢視原始碼)
- 模块:Category handler/config(檢視原始碼)
- 模块:Category handler/data(檢視原始碼)
- 模块:Category handler/shared(檢視原始碼)
- 模块:Citation/CS1/Date validation/doc(檢視原始碼)
- 模块:Message box(檢視原始碼)
- 模块:Message box/configuration(檢視原始碼)
- 模块:Namespace detect/config(檢視原始碼)
- 模块:Namespace detect/data(檢視原始碼)
- 模块:Yesno(檢視原始碼)