Skip to content

Commit

Permalink
Added OrthodoxEaster to built in events
Browse files Browse the repository at this point in the history
  • Loading branch information
smurfier committed Jun 26, 2014
1 parent 9e78bab commit b253149
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions @Resources/CScript.lua
Original file line number Diff line number Diff line change
Expand Up @@ -897,6 +897,31 @@ BuiltIn = {
mardigras = function() -- Old style format. To be removed later
return Easter() - 47 * 86400
end,

orthodoxeaster = function()
-- Original Source: http://www.smart.net/~mmontes/ortheast.html

--[[local R1 = Time.show.year % 19
local R2 = Time.show.year % 4
local R3 = Time.show.year % 7
local RA = 19 * R1 + 16
local R4 = RA % 30
local RB = 2 * R2 + 4 * R3 + 6 * R4
local R5 = RB % 7
local RC = R4 + R5]]

local R4 = (19 * (Time.show.year % 19) + 16) % 30
local RC = R4 + ((2 * (Time.show.year % 4) + 4 * (Time.show.year % 7) + 6 * R4) % 7)

local stamp = os.time{
year = Time.show.year,
month = 4,
day = 3,
isdst = false,
}

return stamp + RC * 86400
end,
} -- BuiltIn

function ParseVariables(line, FileName, ErrorSubstitute) -- Makes allowance for {$Variables}
Expand Down

0 comments on commit b253149

Please sign in to comment.