Module:Weekly site information

From Our World of Text Wiki
Revision as of 13:01, 13 November 2024 by Dat Hack3r (talk | contribs) (Created module.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

local p = {}

function p.lastReleaseNumber(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