1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

990918-repack

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@531 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 1999-09-18 04:48:51 +00:00
parent 12494013d2
commit 7152df6b9b
11 changed files with 107 additions and 74 deletions

View file

@ -1,12 +1,25 @@
#! /usr/local/bin/ruby
# goodfriday.rb: Written by Tadayoshi Funaba 1998
# $Id: goodfriday.rb,v 1.3 1999/08/04 14:54:18 tadf Exp $
# $Id: goodfriday.rb,v 1.1 1998/03/08 09:44:44 tadf Exp $
require 'date2'
require 'holiday'
es = Date.easter(Date.today.year)
def easter(y)
g = (y % 19) + 1
c = (y / 100) + 1
x = (3 * c / 4) - 12
z = ((8 * c + 5) / 25) - 5
d = (5 * y / 4) - x - 10
e = (11 * g + 20 + z - x) % 30
e += 1 if e == 25 and g > 11 or e == 24
n = 44 - e
n += 30 if n < 21
n = n + 7 - ((d + n) % 7)
if n <= 31 then [y, 3, n] else [y, 4, n - 31] end
end
es = Date.new3(*easter(Time.now.year))
[[-9*7, 'Septuagesima Sunday'],
[-8*7, 'Sexagesima Sunday'],
[-7*7, 'Quinquagesima Sunday (Shrove Sunday)'],