Module:BassaridianCalendar: Difference between revisions
From MicrasWiki
Jump to navigationJump to search
NewZimiaGov (talk | contribs) No edit summary |
NewZimiaGov (talk | contribs) No edit summary |
||
Line 16: | Line 16: | ||
local dayOfYear = math.floor((yearFraction - psscYear) * daysPerYear) + 1 | local dayOfYear = math.floor((yearFraction - psscYear) * daysPerYear) + 1 | ||
-- Correctly determine the PSSC year | -- Correctly determine the PSSC year | ||
local correctedYear = psscYear -- This should directly give the year | local correctedYear = psscYear -- This should directly give the year | ||
-- Determine month and day within the month | -- Determine month and day within the month | ||
Line 25: | Line 25: | ||
dayInMonth = dayOfYear | dayInMonth = dayOfYear | ||
if dayInMonth <= 12 then | if dayInMonth <= 12 then | ||
zodiac = "Atosien" | zodiac = "[[Reformed_Stripping_Path#Overview_of_the_Bassaridian_Zodiac|Atosien]]" | ||
elseif dayInMonth <= 24 then | elseif dayInMonth <= 24 then | ||
zodiac = "Eosena" | zodiac = "[[Reformed_Stripping_Path#Overview_of_the_Bassaridian_Zodiac|Eosena]]" | ||
elseif dayInMonth <= 36 then | elseif dayInMonth <= 36 then | ||
zodiac = "Micrasha" | zodiac = "[[Reformed_Stripping_Path#Overview_of_the_Bassaridian_Zodiac|Micrasha]]" | ||
elseif dayInMonth <= 48 then | elseif dayInMonth <= 48 then | ||
zodiac = "Pyreska" | zodiac = "[[Reformed_Stripping_Path#Overview_of_the_Bassaridian_Zodiac|Pyreska]]" | ||
else | else | ||
zodiac = "Indomin" | zodiac = "[[Reformed_Stripping_Path#Overview_of_the_Bassaridian_Zodiac|Indomin]]" | ||
end | end | ||
elseif dayOfYear <= 122 then | elseif dayOfYear <= 122 then | ||
Line 39: | Line 39: | ||
dayInMonth = dayOfYear - 61 | dayInMonth = dayOfYear - 61 | ||
if dayInMonth <= 12 then | if dayInMonth <= 12 then | ||
zodiac = "Chrysen" | zodiac = "[[Reformed_Stripping_Path#Overview_of_the_Bassaridian_Zodiac|Chrysen]]" | ||
elseif dayInMonth <= 24 then | elseif dayInMonth <= 24 then | ||
zodiac = "Thalassian" | zodiac = "[[Reformed_Stripping_Path#Overview_of_the_Bassaridian_Zodiac|Thalassian]]" | ||
elseif dayInMonth <= 36 then | elseif dayInMonth <= 36 then | ||
zodiac = "Nephelia" | zodiac = "[[Reformed_Stripping_Path#Overview_of_the_Bassaridian_Zodiac|Nephelia]]" | ||
elseif dayInMonth <= 48 then | elseif dayInMonth <= 48 then | ||
zodiac = "Glinaeus" | zodiac = "[[Reformed_Stripping_Path#Overview_of_the_Bassaridian_Zodiac|Glinaeus]]" | ||
else | else | ||
zodiac = "Noctien" | zodiac = "[[Reformed_Stripping_Path#Overview_of_the_Bassaridian_Zodiac|Noctien]]" | ||
end | end | ||
else | else | ||
Line 53: | Line 53: | ||
dayInMonth = dayOfYear - 122 | dayInMonth = dayOfYear - 122 | ||
if dayInMonth <= 12 then | if dayInMonth <= 12 then | ||
zodiac = "Opsithia" | zodiac = "[[Reformed_Stripping_Path#Overview_of_the_Bassaridian_Zodiac|Opsithia]]" | ||
elseif dayInMonth <= 24 then | elseif dayInMonth <= 24 then | ||
zodiac = "Stygian" | zodiac = "[[Reformed_Stripping_Path#Overview_of_the_Bassaridian_Zodiac|Stygian]]" | ||
elseif dayInMonth <= 36 then | elseif dayInMonth <= 36 then | ||
zodiac = "Faunian" | zodiac = "[[Reformed_Stripping_Path#Overview_of_the_Bassaridian_Zodiac|Faunian]]" | ||
elseif dayInMonth <= 48 then | elseif dayInMonth <= 48 then | ||
zodiac = "Silenian" | zodiac = "[[Reformed_Stripping_Path#Overview_of_the_Bassaridian_Zodiac|Silenian]]" | ||
else | else | ||
zodiac = "Catosien" | zodiac = "[[Reformed_Stripping_Path#Overview_of_the_Bassaridian_Zodiac|Catosien]]" | ||
end | end | ||
end | end |
Revision as of 02:58, 11 December 2024
Documentation for this module may be created at Module:BassaridianCalendar/doc
local p = {} function p.getCurrentDate() -- Constants local startDate = os.time({year = 1999, month = 8, day = 6}) -- August 6, 1999 local secondsInDay = 24 * 60 * 60 -- Number of seconds in a day local daysPerYear = 183 -- Current date local currentDate = os.time() local totalDaysElapsed = math.floor((currentDate - startDate) / secondsInDay) -- Calculate PSSC year and day local yearFraction = totalDaysElapsed / daysPerYear local psscYear = math.floor(yearFraction) -- Correctly calculate year local dayOfYear = math.floor((yearFraction - psscYear) * daysPerYear) + 1 -- Correctly determine the PSSC year local correctedYear = psscYear -- This should directly give the year -- Determine month and day within the month local month, dayInMonth, zodiac if dayOfYear <= 61 then month = "Atosiel" dayInMonth = dayOfYear if dayInMonth <= 12 then zodiac = "[[Reformed_Stripping_Path#Overview_of_the_Bassaridian_Zodiac|Atosien]]" elseif dayInMonth <= 24 then zodiac = "[[Reformed_Stripping_Path#Overview_of_the_Bassaridian_Zodiac|Eosena]]" elseif dayInMonth <= 36 then zodiac = "[[Reformed_Stripping_Path#Overview_of_the_Bassaridian_Zodiac|Micrasha]]" elseif dayInMonth <= 48 then zodiac = "[[Reformed_Stripping_Path#Overview_of_the_Bassaridian_Zodiac|Pyreska]]" else zodiac = "[[Reformed_Stripping_Path#Overview_of_the_Bassaridian_Zodiac|Indomin]]" end elseif dayOfYear <= 122 then month = "Thalassiel" dayInMonth = dayOfYear - 61 if dayInMonth <= 12 then zodiac = "[[Reformed_Stripping_Path#Overview_of_the_Bassaridian_Zodiac|Chrysen]]" elseif dayInMonth <= 24 then zodiac = "[[Reformed_Stripping_Path#Overview_of_the_Bassaridian_Zodiac|Thalassian]]" elseif dayInMonth <= 36 then zodiac = "[[Reformed_Stripping_Path#Overview_of_the_Bassaridian_Zodiac|Nephelia]]" elseif dayInMonth <= 48 then zodiac = "[[Reformed_Stripping_Path#Overview_of_the_Bassaridian_Zodiac|Glinaeus]]" else zodiac = "[[Reformed_Stripping_Path#Overview_of_the_Bassaridian_Zodiac|Noctien]]" end else month = "Opsitheiel" dayInMonth = dayOfYear - 122 if dayInMonth <= 12 then zodiac = "[[Reformed_Stripping_Path#Overview_of_the_Bassaridian_Zodiac|Opsithia]]" elseif dayInMonth <= 24 then zodiac = "[[Reformed_Stripping_Path#Overview_of_the_Bassaridian_Zodiac|Stygian]]" elseif dayInMonth <= 36 then zodiac = "[[Reformed_Stripping_Path#Overview_of_the_Bassaridian_Zodiac|Faunian]]" elseif dayInMonth <= 48 then zodiac = "[[Reformed_Stripping_Path#Overview_of_the_Bassaridian_Zodiac|Silenian]]" else zodiac = "[[Reformed_Stripping_Path#Overview_of_the_Bassaridian_Zodiac|Catosien]]" end end -- Event lookup table local events = { ["Atosiel,6"] = "Bayram al-Nur (Festival of Light)", ["Atosiel,18"] = "Chag Or Hadash (Festival of New Light)", ["Atosiel,30"] = "Symposion Eirinis (Symposium of Harmony)", ["Atosiel,43"] = "Alev Günü (Day of Flame)", ["Atosiel,55"] = "Tikkun Tzel (Repair of Shadows)", ["Thalassiel,67"] = "Panegyris Chrysou (Golden Gathering)", ["Thalassiel,80"] = "Mehtap Dalgası (Moonlit Tide)", ["Thalassiel,92"] = "Oneiro Foteino (Dream of Illumination)", ["Thalassiel,105"] = "Erev Galgal (Eve of Cycles)", ["Thalassiel,115"] = "Leilat al-Kamar (Night of the Moon)", ["Opsitheiel,128"] = "Chag Tvuah (Festival of Harvest)", ["Opsitheiel,140"] = "Anagenesis Eirmos (Procession of Rebirth)", ["Opsitheiel,150"] = "Panagia Therizis (Holy Day of the Reaper)", ["Opsitheiel,165"] = "Karnavali Thysias (Carnival of Celebration)", ["Opsitheiel,175"] = "Sefar Yashar (Straight Path Celebration)" } -- Find the event for the current day local eventKey = month .. "," .. dayInMonth local event = events[eventKey] or "No significant events today." -- Return the formatted date return dayOfYear .. ", " .. month .. " (" .. zodiac .. "), " .. correctedYear .. " PSSC – " .. event end return p