模板:Documentation:修订间差异
外观
创建页面,内容为“<div class="template-documentation" style="background: aliceblue; padding: 1em; border: 1px solid #aaa;"><!-- --><div class="template-documentation-header" style="p…” |
小 已保护“模板:Documentation”([编辑=仅允许管理员](无限期)[移动=仅允许管理员](无限期)) |
||
(没有差异)
| |||
2020年5月30日 (六) 00:06的最新版本
-- 预定义的联赛日期表(2025-2035年五月的第二个星期日) local olympiadDates = {
"2025-05-11", "2026-05-10", "2027-05-09", "2028-05-14", "2029-05-13", "2030-05-12", "2031-05-11", "2032-05-09", "2033-05-08", "2034-05-14", "2035-05-13"
}
function p.getNextDate()
local currentTime = os.time()
for i, dateStr in ipairs(olympiadDates) do
local datePattern = "(%d+)-(%d+)-(%d+)"
local year, month, day = dateStr:match(datePattern)
local olympiadTime = os.time({year = year, month = month, day = day})
if olympiadTime > currentTime then
return dateStr
end
end
-- 如果所有日期都已过去,返回最后一个日期
return olympiadDates[#olympiadDates]
end
return p|action=edit}} 创建]] [刷新]