Module:ScheduleList:修订间差异
跳转到导航
跳转到搜索
无编辑摘要 |
无编辑摘要 |
||
第60行: | 第60行: | ||
local title = args["title" .. i] or "无" -- 未提供标题时默认 "无" | local title = args["title" .. i] or "无" -- 未提供标题时默认 "无" | ||
local time = args["time" .. i] or "2:00" -- 未提供时间时默认 "2:00" | local time = args["time" .. i] or "2:00" -- 未提供时间时默认 "2:00" | ||
local class = args["class" .. i] or "" -- 未提供 class 时默认空字符串 | |||
local week_day = get_next_weekday(current_weekday - 1) -- 计算周几 | local week_day = get_next_weekday(current_weekday - 1) -- 计算周几 | ||
第68行: | 第69行: | ||
} | } | ||
-- | -- 格式化当前行,添加 class | ||
table.insert(result, string.format("%s<small>%s</small> %s | if class ~= "" then | ||
table.insert(result, string.format('<div class="%s">%s<small>%s</small> %s</div>', class, ruby_output, week_day, title)) | |||
else | |||
table.insert(result, string.format('%s<small>%s</small> %s', ruby_output, week_day, title)) | |||
end | |||
-- 更新日期和周几 | -- 更新日期和周几 | ||
第76行: | 第81行: | ||
end | end | ||
-- | -- 返回结果,每行分开 | ||
return table.concat(result, "\n") | return table.concat(result, "\n") | ||
end | end | ||
return p | return p |