跳转到内容
主菜单
主菜单
移至侧栏
隐藏
导航
首页
天灾之下:危险连接官网(建设中)
天灾之下:危险连接QQ群
天灾之下:危险连接 Bilibili
冰糖服务器
冰糖服务器QQ群
天灾之下:危险连接资料站
搜索
搜索
中文(中国大陆)
外观
创建账号
登录
个人工具
创建账号
登录
查看“︁模块:Wikimedia engineering project date categories”︁的源代码
模块
讨论
English
阅读
查看源代码
查看历史
工具
工具
移至侧栏
隐藏
操作
阅读
查看源代码
查看历史
常规
链入页面
相关更改
页面信息
[[雷光]]
外观
移至侧栏
隐藏
←
模块:Wikimedia engineering project date categories
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
-- Module to output [[:Category:WMF Projects]] subcategories -- as appropriate for a start and end date, to be used in -- {{Wikimedia engineering project information}} local yn = require("Module:Yesno") local p = {} local lang = mw.language.getContentLanguage() local function makeCategory( catdate, trail ) local quarter, year quarter = math.ceil( tonumber( lang:formatDate( "m", catdate ) ) / 3 ) year = lang:formatDate( "Y", catdate ) return "[[Category:WMF Projects " .. year .. "q" .. tostring( quarter ) .. trail .. "]]" end function p.datesToCategories( frame ) return p._datesToCategories( frame.args, frame ); end function p._datesToCategories( args, frame ) frame = frame or mw.getCurrentFrame(); local startdate, curdate, enddate local categories = "" local trail = frame:callParserFunction("#translation:") local nocat = yn(args.nocat) if (nocat == nil) then local title = mw.title.getCurrentTitle() nocat = (title and title.subpageText and mw.language.isSupportedLanguage(title.subpageText) and not (title.subpageText == mw.language.getContentLanguage():getCode())) or false end if (not args.startdate) or args.startdate == "" then return nocat and "" or "[[Category:WMF Projects missing start date" .. trail .. "]]" else curdate = args.startdate if string.len(curdate) < 4 then return nocat and "" or "[[Category:WMF Projects missing start date" .. trail .. "]]" end if string.len(curdate) == 4 then curdate = curdate .. "-01" end end local now = lang:formatDate("U") if (not args.enddate) or args.enddate == "" then -- Ends now enddate = now else enddate = args.enddate if string.len(enddate) == 4 then enddate = enddate .. "-12" end enddate = lang:formatDate("U", enddate) end if enddate >= now then -- Current project -- In unusual circumstances like [[Extension:Chart/Project]] a project can have a known future end date -- treat that the same way as a current end date for categorization categories = categories .. "[[Category:WMF Projects" .. trail .. "]]" enddate = now end if nocat then -- Don't populate WMF quarter categories with translations of every page return categories end trail = "" while lang:formatDate( "U", curdate ) < enddate do categories = categories .. makeCategory( curdate, trail ) curdate = lang:formatDate( "Y-m-d", curdate .. "+3 months" ) end categories = categories .. makeCategory( "@"..enddate, trail ) return categories end return p
该页面嵌入的页面:
模块:Wikimedia engineering project date categories/doc
(
查看源代码
)
返回
模块:Wikimedia engineering project date categories
。
搜索
搜索
查看“︁模块:Wikimedia engineering project date categories”︁的源代码
添加语言
添加话题