Module:Weekly site information: Difference between revisions
Jump to navigation
Jump to search
Dat Hack3r (talk | contribs) (Created module.) |
Dat Hack3r (talk | contribs) m (This should be named main.) |
||
Line 1: | Line 1: | ||
local p = {} | local p = {} | ||
function p. | function p.main(frame) | ||
-- Define the start date of Week 1 | -- Define the start date of Week 1 | ||
local week1Start = os.time{year=2024, month=9, day=8} | local week1Start = os.time{year=2024, month=9, day=8} |
Revision as of 20:44, 17 November 2024
This Lua module is a high priority for maintenance as it is original to the OWOT Wiki and used in articles. As such, this module may contain bugs and it should be a top priority of module maintainers to quickly fix any issues that arise with it. Discuss breaking changes on the talk page before implementing them. |
This module implements {{Weekly site information}}
.
local p = {}
function p.main(frame)
-- Define the start date of Week 1
local week1Start = os.time{year=2024, month=9, day=8}
-- Get current date
local currentDate = os.time()
-- Calculate the difference in days from the start of Week 1 to the current date
local daysDifference = os.difftime(currentDate, week1Start) / (24 * 60 * 60)
-- Return the last Weekly Briefing Release
return math.floor(daysDifference / 7)
end
return p