Module:Zodiac date: Difference between revisions

Content deleted Content added
m Jc3s5h moved page Module:Zodiac dates to Module:Zodiac date without leaving a redirect: Spelling more similar to the template it is replacing
m Reverted 3 edits by AgorahillsCW (talk) to last revision by Jc3s5h
 
(16 intermediate revisions by 9 users not shown)
Line 1:
-- Module:Zodiac date
local p = {}
 
function p.main( frame )
local signNumber = tonumber(frame.args[1]) or 1
local year = tonumber(frame.args[2]) or os.date("!*t").year
local year = 0 -- initialize so it will defined no matter which path the if
-- statement takes
if frame.args[2] == nil then
t = os.date("*t") -- Get the current year.
year = tonumber(t["year"])
else
year = tonumber(frame.args[2]) -- The call is requesting a particular year.
end
--<span style="color:red">red writing</span>
if (year < 2015) or (year > 2050) or ((year == 2050) and (signNumber == 10)) then
Line 21 ⟶ 15:
 
 
local sn = {3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 1, 2}
signNumber = sn[signNumber]
year = year-2015
 
local zd = {
"January 20", "February 18", "March 20", "April 20", "May 21", "June 21",
"July 23", "August 23", "September 23", "October 23", "November 22", "December 22",