5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
# File 'lib/akatosh_bot.rb', line 5
def tamriel opts = {}
d = mday
e = opts[:era].is_a?(Fixnum) ? opts[:era] : 4
i = opts[:year]
m = month
w = wday
y = year
tam_wday = %w[
Sundas
Morndas
Tirdas
Middas
Turdas
Fredas
Loredas
][w]
datesuf = %w[th st nd rd][d / 10 != 1 && d % 10 < 4 ? d % 10 : 0]
tam_month = [
"Morning Star",
"Sun's Dawn",
"First Seed",
"Rain's Hand",
"Second Seed",
"Midyear",
"Sun's Height",
"Last Seed",
"Hearthfire",
"Frostfall",
"Sun's Dusk",
"Evening Star"
][m - 1]
tam_year = i.is_a?(String) ? ", #{i}" : i ? ", #{e}E#{i.is_a?(Fixnum) ? i : y - 1810}" : ""
"#{tam_wday}, #{d}#{datesuf} of #{tam_month}#{tam_year}"
end
|