查看“模块: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
הההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
000
1:0
调试控制台
* 此模块的返回的值存于控制台变量“p”中,包括没有保存的变更。 * 在一行的前面加上“=”或使用print()可以将其作为表达式来计算。表格请使用mw.logObject()。 * 在模块代码中使用mw.log()和mw.logObject()来向控制台发送消息。

返回至模块:Citation/CS1/Date validation