when_exe 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +36 -33
- data/bin/locales.rb +1 -1
- data/bin/make_ttl.rb.config +1 -1
- data/lib/when_exe.rb +27 -16
- data/lib/when_exe/basictypes.rb +772 -771
- data/lib/when_exe/calendartypes.rb +1485 -1453
- data/lib/when_exe/coordinates.rb +5 -0
- data/lib/when_exe/core/compatibility.rb +1 -1
- data/lib/when_exe/core/duration.rb +147 -116
- data/lib/when_exe/core/extension.rb +499 -497
- data/lib/when_exe/ephemeris.rb +1952 -1951
- data/lib/when_exe/ephemeris/eclipse.rb +5 -4
- data/lib/when_exe/ephemeris/notes.rb +457 -421
- data/lib/when_exe/ephemeris/planets.rb +585 -585
- data/lib/when_exe/ephemeris/sun.rb +214 -214
- data/lib/when_exe/google_api.rb +153 -0
- data/lib/when_exe/icalendar.rb +1640 -1632
- data/lib/when_exe/inspect.rb +42 -20
- data/lib/when_exe/linkeddata.rb +28 -7
- data/lib/when_exe/locales/autoload.rb +2 -1
- data/lib/when_exe/locales/locale.rb +35 -15
- data/lib/when_exe/locales/zh.rb +77 -0
- data/lib/when_exe/mini_application.rb +3 -1
- data/lib/when_exe/{googlecalendar.rb → obsolete/googlecalendar.rb} +144 -144
- data/lib/when_exe/parts/enumerator.rb +498 -486
- data/lib/when_exe/parts/geometric_complex.rb +397 -397
- data/lib/when_exe/parts/timezone.rb +246 -241
- data/lib/when_exe/region/armenian.rb +55 -56
- data/lib/when_exe/region/babylonian.rb +406 -405
- data/lib/when_exe/region/bahai.rb +107 -106
- data/lib/when_exe/region/balinese.rb +624 -622
- data/lib/when_exe/region/chinese.rb +1071 -1026
- data/lib/when_exe/region/chinese/epochs.rb +28 -28
- data/lib/when_exe/region/chinese/notes.rb +219 -0
- data/lib/when_exe/region/chinese/twins.rb +803 -803
- data/lib/when_exe/region/christian.rb +21 -15
- data/lib/when_exe/region/coptic.rb +107 -106
- data/lib/when_exe/region/discordian.rb +218 -218
- data/lib/when_exe/region/east_asian.rb +1 -1
- data/lib/when_exe/region/french.rb +126 -56
- data/lib/when_exe/region/geologicalage.rb +639 -639
- data/lib/when_exe/region/goddess.rb +60 -58
- data/lib/when_exe/region/hanke_henry.rb +2 -2
- data/lib/when_exe/region/indian.rb +1225 -1222
- data/lib/when_exe/region/international_fixed.rb +96 -97
- data/lib/when_exe/region/iranian.rb +206 -203
- data/lib/when_exe/region/islamic.rb +102 -102
- data/lib/when_exe/region/japanese.rb +126 -71
- data/lib/when_exe/region/japanese/epochs.rb +426 -426
- data/lib/when_exe/region/japanese/notes.rb +101 -81
- data/lib/when_exe/region/japanese/residues.rb +1345 -1311
- data/lib/when_exe/region/japanese/twins.rb +225 -225
- data/lib/when_exe/region/japanese/weeks.rb +112 -112
- data/lib/when_exe/region/javanese.rb +230 -230
- data/lib/when_exe/region/jewish.rb +130 -131
- data/lib/when_exe/region/m17n.rb +114 -114
- data/lib/when_exe/region/martian.rb +258 -258
- data/lib/when_exe/region/mayan.rb +11 -8
- data/lib/when_exe/region/pax.rb +4 -5
- data/lib/when_exe/region/pope.rb +1 -1
- data/lib/when_exe/region/positivist.rb +100 -100
- data/lib/when_exe/region/residue.rb +162 -162
- data/lib/when_exe/region/roman.rb +333 -333
- data/lib/when_exe/region/{soviet.rb → russian.rb} +221 -209
- data/lib/when_exe/region/shire.rb +222 -223
- data/lib/when_exe/region/symmetry.rb +50 -50
- data/lib/when_exe/region/thai.rb +336 -336
- data/lib/when_exe/region/tibetan.rb +315 -316
- data/lib/when_exe/region/tranquility.rb +207 -208
- data/lib/when_exe/region/vanishing_leprechaun.rb +3 -1
- data/lib/when_exe/region/vietnamese.rb +449 -440
- data/lib/when_exe/region/weekdate.rb +80 -80
- data/lib/when_exe/region/world.rb +170 -171
- data/lib/when_exe/region/world_season.rb +89 -89
- data/lib/when_exe/region/yerm.rb +3 -3
- data/lib/when_exe/region/zoroastrian.rb +205 -205
- data/lib/when_exe/timestandard.rb +708 -707
- data/lib/when_exe/tmduration.rb +338 -338
- data/lib/when_exe/tmobjects.rb +1356 -1356
- data/lib/when_exe/tmposition.rb +66 -31
- data/lib/when_exe/version.rb +16 -2
- data/test/examples/Residue.m17n +83 -83
- data/test/examples/Terms.m17n +2 -2
- data/test/test.rb +2 -2
- data/test/test/google_api.rb +65 -0
- data/test/test/linkeddata.rb +1 -1
- data/test/test/{googlecalendar.rb → obsolete/googlecalendar.rb} +194 -194
- data/test/test/region/indian.rb +90 -85
- data/test/test/region/m17n.rb +7 -7
- data/test/test/region/mayan.rb +195 -195
- data/test/test/region/residue.rb +153 -153
- data/test/test/tmposition.rb +11 -1
- data/when_exe.gemspec +2 -2
- metadata +95 -8
- data/test/test.rb.config +0 -1
@@ -1,97 +1,96 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
=begin
|
3
|
-
Copyright (C) 2014 Takashi SUGA
|
4
|
-
|
5
|
-
You may use and/or modify this file according to the license described in the LICENSE.txt file included in this archive.
|
6
|
-
=end
|
7
|
-
|
8
|
-
module When
|
9
|
-
|
10
|
-
class BasicTypes::M17n
|
11
|
-
|
12
|
-
InternationalFixed = [self, [
|
13
|
-
"locale:[=en:, ja=ja:, alias]",
|
14
|
-
"names:[InternationalFixed=]"
|
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
|
-
"[
|
44
|
-
"[
|
45
|
-
"[
|
46
|
-
"[
|
47
|
-
"[
|
48
|
-
"[
|
49
|
-
"[
|
50
|
-
"[
|
51
|
-
"[
|
52
|
-
"[
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
"
|
62
|
-
[DayOfWeek, "label:[
|
63
|
-
[DayOfWeek, "label:[
|
64
|
-
[DayOfWeek, "label:[
|
65
|
-
[DayOfWeek, "label:[
|
66
|
-
[DayOfWeek, "label:[
|
67
|
-
[DayOfWeek, "label:[
|
68
|
-
[DayOfWeek, "label:[
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
#
|
82
|
-
#
|
83
|
-
|
84
|
-
|
85
|
-
'
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
end
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
=begin
|
3
|
+
Copyright (C) 2014-2015 Takashi SUGA
|
4
|
+
|
5
|
+
You may use and/or modify this file according to the license described in the LICENSE.txt file included in this archive.
|
6
|
+
=end
|
7
|
+
|
8
|
+
module When
|
9
|
+
|
10
|
+
class BasicTypes::M17n
|
11
|
+
|
12
|
+
InternationalFixed = [self, [
|
13
|
+
"locale:[=en:, ja=ja:, zh=zh:, alias]",
|
14
|
+
"names:[InternationalFixed=en:International_Fixed_Calendar, 国際固定暦, 国際固定曆=]"
|
15
|
+
]]
|
16
|
+
end
|
17
|
+
|
18
|
+
#
|
19
|
+
# InternationalFixed Week
|
20
|
+
#
|
21
|
+
class CalendarNote::InternationalFixedWeek < CalendarNote::Week
|
22
|
+
|
23
|
+
#
|
24
|
+
# InternationalFixed Note
|
25
|
+
#
|
26
|
+
Notes = [When::BasicTypes::M17n, [
|
27
|
+
"locale:[=en:, ja=ja:, alias]",
|
28
|
+
"names:[InternationalFixed]",
|
29
|
+
|
30
|
+
# Notes for year ----------------------------
|
31
|
+
[When::BasicTypes::M17n,
|
32
|
+
"names:[note for year=, 年の暦注=, *year]"
|
33
|
+
],
|
34
|
+
|
35
|
+
# Notes for month ----------------------------
|
36
|
+
[When::BasicTypes::M17n,
|
37
|
+
"names:[note for month=, 月の暦注=, *month]",
|
38
|
+
[When::BasicTypes::M17n,
|
39
|
+
"names:[month name=en:Month, 月の名前=ja:%%<月_(暦)>, zh:該月的名稱=, *alias:Month=]",
|
40
|
+
"[January, 1月, /date/month_names/1] ",
|
41
|
+
"[February, 2月, /date/month_names/2] ",
|
42
|
+
"[March, 3月, /date/month_names/3] ",
|
43
|
+
"[April, 4月, /date/month_names/4] ",
|
44
|
+
"[May, 5月, /date/month_names/5] ",
|
45
|
+
"[June, 6月, /date/month_names/6] ",
|
46
|
+
"[Sol, 7月 ] ",
|
47
|
+
"[July, 8月, /date/month_names/7] ",
|
48
|
+
"[August, 9月, /date/month_names/8] ",
|
49
|
+
"[September,10月, /date/month_names/9] ",
|
50
|
+
"[October, 11月, /date/month_names/10]",
|
51
|
+
"[November, 12月, /date/month_names/11]",
|
52
|
+
"[December, 13月, /date/month_names/12]"
|
53
|
+
]
|
54
|
+
],
|
55
|
+
|
56
|
+
# Notes for day ----------------------------
|
57
|
+
[When::BasicTypes::M17n,
|
58
|
+
"names:[note for day=, 日の暦注=, *day]",
|
59
|
+
[When::BasicTypes::M17n,
|
60
|
+
"names:[Week, 週, zh:星期]",
|
61
|
+
[DayOfWeek, "label:[Sunday, 日曜日, /date/day_names/0]", {'delta'=> 7}],
|
62
|
+
[DayOfWeek, "label:[Monday, 月曜日, /date/day_names/1]", {'delta'=> 7}],
|
63
|
+
[DayOfWeek, "label:[Tuesday, 火曜日, /date/day_names/2]", {'delta'=> 7}],
|
64
|
+
[DayOfWeek, "label:[Wednesday, 水曜日, /date/day_names/3]", {'delta'=> 7}],
|
65
|
+
[DayOfWeek, "label:[Thursday, 木曜日, /date/day_names/4]", {'delta'=> 7}],
|
66
|
+
[DayOfWeek, "label:[Friday, 金曜日, /date/day_names/5]", {'delta'=> 7}],
|
67
|
+
[DayOfWeek, "label:[Saturday, 土曜日, /date/day_names/6]", {'delta'=> 7}],
|
68
|
+
[DayOfWeek, "label:[OutOfWeek=, 週外日=]", {'delta'=>366}]
|
69
|
+
],
|
70
|
+
|
71
|
+
"[Common_Week=]"
|
72
|
+
]
|
73
|
+
]]
|
74
|
+
|
75
|
+
fixed_week_definitions
|
76
|
+
|
77
|
+
end
|
78
|
+
|
79
|
+
module CalendarTypes
|
80
|
+
#
|
81
|
+
# InternationalFixed calendar based on Gregorian calendar
|
82
|
+
#
|
83
|
+
InternationalFixed = [SolarYearTableBased, {
|
84
|
+
'label' => 'InternationalFixed',
|
85
|
+
'indices' => [
|
86
|
+
When.Index('InternationalFixedWeekNotes::month::Month', {:unit =>13}),
|
87
|
+
When::Coordinates::DefaultDayIndex
|
88
|
+
],
|
89
|
+
'rule_table' => {
|
90
|
+
365 => {'Length'=>[28]*12 + [29]},
|
91
|
+
366 => {'Length'=>[28]* 5 + [29] + [28] *6 + [29]}
|
92
|
+
},
|
93
|
+
'note' => 'InternationalFixedWeek'
|
94
|
+
}]
|
95
|
+
end
|
96
|
+
end
|
@@ -1,203 +1,206 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
=begin
|
3
|
-
Copyright (C) 2011-
|
4
|
-
|
5
|
-
You may use and/or modify this file according to the license described in the LICENSE.txt file included in this archive.
|
6
|
-
=end
|
7
|
-
|
8
|
-
module When
|
9
|
-
class BasicTypes::M17n
|
10
|
-
|
11
|
-
Iranian = [self, [
|
12
|
-
"locale:[=en:, ja=ja:,
|
13
|
-
"names:[Iranian=]",
|
14
|
-
"[SolarHijri=en:Solar_Hijri_calendar#Details_of_the_modern_calendar, ヘジラ太陽暦=ja
|
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
|
-
"[
|
44
|
-
"[
|
45
|
-
"[
|
46
|
-
"[
|
47
|
-
"[
|
48
|
-
"[
|
49
|
-
"[
|
50
|
-
|
51
|
-
]
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
["[
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
'
|
103
|
-
'
|
104
|
-
'
|
105
|
-
'
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
'
|
119
|
-
'
|
120
|
-
'
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
'
|
125
|
-
'
|
126
|
-
'
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
'
|
149
|
-
'
|
150
|
-
'
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
'
|
155
|
-
'
|
156
|
-
'
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
'
|
170
|
-
'
|
171
|
-
'
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
'
|
182
|
-
'
|
183
|
-
'
|
184
|
-
'
|
185
|
-
'
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
111211000900 011211000900
|
201
|
-
|
202
|
-
|
203
|
-
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
=begin
|
3
|
+
Copyright (C) 2011-2015 Takashi SUGA
|
4
|
+
|
5
|
+
You may use and/or modify this file according to the license described in the LICENSE.txt file included in this archive.
|
6
|
+
=end
|
7
|
+
|
8
|
+
module When
|
9
|
+
class BasicTypes::M17n
|
10
|
+
|
11
|
+
Iranian = [self, [
|
12
|
+
"locale:[=en:, ja=ja:, zh=zh:, alias=ja:]",
|
13
|
+
"names:[Iranian=en:Iranian_calendars, イラン暦, 伊朗曆]",
|
14
|
+
"[SolarHijri=en:Solar_Hijri_calendar#Details_of_the_modern_calendar, ヘジラ太陽暦=ja:%%<イラン暦>, 希吉拉陽曆=zh:%%<伊朗曆>]",
|
15
|
+
"[SolarHijri (Combined)=en:Solar_Hijri_calendar#Details_of_the_modern_calendar, ヘジラ太陽暦(多種接続)=ja:%%<イラン暦>, 希吉拉陽曆(連接起來)=zh:%%<伊朗曆>]",
|
16
|
+
"[SolarHijriAlgorithmic=en:Solar_Hijri_calendar#Solar_Hijri_algorithmic_calendar, ヘジラ太陽暦(2820年周期)=ja:%%<イラン暦>, 希吉拉陽曆(2820年週期)=zh:%%<伊朗曆>]",
|
17
|
+
"[Jalali=en:Jalali_calendar, ジャラーリー暦, 波斯曆=]",
|
18
|
+
"[JalaliAlgorithmic=en:Jalali_calendar, ジャラーリー暦(2820年周期)=ja:%%<ジャラーリー暦>, 波斯曆(2820年週期)=]",
|
19
|
+
"[Borji=, ボルジ暦=]",
|
20
|
+
|
21
|
+
[self,
|
22
|
+
"locale:[=en:, ja=ja:, ar=ar:, alias=ja:]",
|
23
|
+
"names:[month name=en:Month, 月の名前=ja:%%<月_(暦)>, zh:該月的名稱=, *alias:Month=]",
|
24
|
+
"[Farvardīn=, ファルヴァルディーン=, فروردین=, フラワシ ]",
|
25
|
+
"[Ordībehesht=, オルディーベヘシュト=, اردیبهشت=, アシャ・ワヒシュタ ]",
|
26
|
+
"[Khordād=, ホルダード=, خرداد=, ハルワタート ]",
|
27
|
+
"[Tīr=, ティール=, تیر=, ティシュトリヤ ]",
|
28
|
+
"[Mordād=, モルダード=, مرداد=, アムルタート ]",
|
29
|
+
"[Shahrīvar=, シャハリーヴァル=, شهریور=, フシャスラ・ワルヤ ]",
|
30
|
+
"[Mehr=, メフル=, مهر=, ミスラ ]",
|
31
|
+
"[Ābān=, アーバーン=, آبان=, アープ ]",
|
32
|
+
"[Āzar=, アーザル=, آذر=, アータル ]",
|
33
|
+
"[Dei=, デイ=, دی=, アフラ・マズダー ]",
|
34
|
+
"[Bahman=, バフマン=, بهمن=, ウォフ・マナフ ]",
|
35
|
+
"[Esfand=, エスファンド=, اسفند=, スプンタ・アールマティ]",
|
36
|
+
"[Andarjah=]"
|
37
|
+
],
|
38
|
+
|
39
|
+
[self,
|
40
|
+
"names:[Sign=en:Astrological_sign, 十二宮]",
|
41
|
+
"[Hamal=, 白羊宮]",
|
42
|
+
"[Thur=, 金牛宮]",
|
43
|
+
"[Jawzā=, 双児宮]",
|
44
|
+
"[Saratān=, 巨蟹宮]",
|
45
|
+
"[Asad=, 獅子宮]",
|
46
|
+
"[Sunbula=, 処女宮]",
|
47
|
+
"[Mizān=, 天秤宮]",
|
48
|
+
"['Aqrab=, 天蝎宮]",
|
49
|
+
"[Qaws=, 人馬宮]",
|
50
|
+
"[Jadi=, 磨羯宮]",
|
51
|
+
"[Dalw=, 宝瓶宮]",
|
52
|
+
"[Hūt=, 双魚宮]"
|
53
|
+
]
|
54
|
+
]]
|
55
|
+
end
|
56
|
+
|
57
|
+
module Coordinates
|
58
|
+
|
59
|
+
# Location of cities in Iran
|
60
|
+
Iranian = [When::BasicTypes::M17n, [
|
61
|
+
"locale:[=en:, ja=ja:, alias]",
|
62
|
+
"names:[Iranian]",
|
63
|
+
[Spatial, "long:51.4045E", "lat:32.3905N", "label:[Isfahan, エスファハーン]"],
|
64
|
+
[Spatial, "long:51.2523E", "lat:35.4146N", "label:[Tehran, テヘラン ]"]
|
65
|
+
]]
|
66
|
+
end
|
67
|
+
|
68
|
+
class TM::CalendarEra
|
69
|
+
|
70
|
+
# イラン暦
|
71
|
+
Iranian = [self, [
|
72
|
+
"area:[Iranian]",
|
73
|
+
["[Anno_Persico=en:Iranian_calendars,*alias:AP]1.1.1", '@CE', "0001-01-01^TableBasedJalali",
|
74
|
+
"1230-01-01^Borji",
|
75
|
+
"1304-01-01^SolarHijri", ""],
|
76
|
+
["[Anno_Cyrus=,*alias:AC]2535.1.1", "", "1355-01-01^SolarHijri"],
|
77
|
+
["[Anno_Hijra=en:Iranian_calendars,*alias:AH]1357.6.5", "@CR", "1357-06-05^SolarHijri"]
|
78
|
+
]]
|
79
|
+
end
|
80
|
+
|
81
|
+
module CalendarTypes
|
82
|
+
|
83
|
+
_indicesM = [
|
84
|
+
When.Index('Iranian::Month', {:unit =>12}),
|
85
|
+
When::Coordinates::DefaultDayIndex
|
86
|
+
]
|
87
|
+
|
88
|
+
_indicesJ = [
|
89
|
+
When.Index('Iranian::Month', {:unit =>13}),
|
90
|
+
When::Coordinates::DefaultDayIndex
|
91
|
+
]
|
92
|
+
|
93
|
+
_indicesS = [
|
94
|
+
When.Index('Iranian::Sign', {:unit =>12}),
|
95
|
+
When::Coordinates::DefaultDayIndex
|
96
|
+
]
|
97
|
+
|
98
|
+
#
|
99
|
+
# Solar Hijri Calendar
|
100
|
+
#
|
101
|
+
SolarHijri = [SolarYearTableBased, {
|
102
|
+
'label' => 'Iranian::SolarHijri',
|
103
|
+
'indices' => _indicesM,
|
104
|
+
'origin_of_MSC' => -621,
|
105
|
+
'epoch_in_CE' => 621,
|
106
|
+
'cycle_offset' => 0,
|
107
|
+
'time_basis' => '+15:30',
|
108
|
+
'rule_table' => {
|
109
|
+
365 => {'Length'=>[31] * 6 + [30] * 5 + [29]},
|
110
|
+
366 => {'Length'=>[31] * 6 + [30] * 6}
|
111
|
+
}
|
112
|
+
}]
|
113
|
+
|
114
|
+
#
|
115
|
+
# Solar Hijri Algorithmic Calendar
|
116
|
+
#
|
117
|
+
SolarHijriAlgorithmic = [CyclicTableBased, {
|
118
|
+
'label' => 'Iranian::SolarHijriAlgorithmic',
|
119
|
+
'indices' => _indicesM,
|
120
|
+
'origin_of_LSC' => 1948321 + 173125,
|
121
|
+
'origin_of_MSC' => 475,
|
122
|
+
'epoch_in_CE' => 621,
|
123
|
+
'rule_table' => {
|
124
|
+
'T' => {'Rule' =>['C128'] * 21 + ['C132']},
|
125
|
+
'C128' => {'Rule' =>['C29'] + ['C33'] * 3},
|
126
|
+
'C132' => {'Rule' =>['C29'] + ['C33'] * 2 + ['C37']},
|
127
|
+
'C29' => {'Rule' =>[365] + ([365] * 3 + [366]) * 7},
|
128
|
+
'C33' => {'Rule' =>[365] + ([365] * 3 + [366]) * 8},
|
129
|
+
'C37' => {'Rule' =>[365] + ([365] * 3 + [366]) * 9},
|
130
|
+
365 => {'Length'=>[31] * 6 + [30] * 5 + [29]},
|
131
|
+
366 => {'Length'=>[31] * 6 + [30] * 6}
|
132
|
+
}
|
133
|
+
}]
|
134
|
+
|
135
|
+
#
|
136
|
+
# Jalali Calendar
|
137
|
+
#
|
138
|
+
Jalali = [HinduSolar, {
|
139
|
+
'label' => 'Iranian::Jalali',
|
140
|
+
'indices' => _indicesM,
|
141
|
+
'type' => 'SBH'
|
142
|
+
}]
|
143
|
+
|
144
|
+
#
|
145
|
+
# Table Based Jalali Calendar
|
146
|
+
#
|
147
|
+
TableBasedJalali = [CyclicTableBased, {
|
148
|
+
'label' => 'Iranian::JalaliAlgorithmic',
|
149
|
+
'indices' => _indicesJ,
|
150
|
+
'origin_of_LSC' => 1948321 + 173125,
|
151
|
+
'origin_of_MSC' => 475,
|
152
|
+
'epoch_in_CE' => 621,
|
153
|
+
'rule_table' => {
|
154
|
+
'T' => {'Rule' =>['C128'] * 21 + ['C132']},
|
155
|
+
'C128' => {'Rule' =>['C29'] + ['C33'] * 3},
|
156
|
+
'C132' => {'Rule' =>['C29'] + ['C33'] * 2 + ['C37']},
|
157
|
+
'C29' => {'Rule' =>[365] + ([365] * 3 + [366]) * 7},
|
158
|
+
'C33' => {'Rule' =>[365] + ([365] * 3 + [366]) * 8},
|
159
|
+
'C37' => {'Rule' =>[365] + ([365] * 3 + [366]) * 9},
|
160
|
+
365 => {'Length'=>[30] * 12 + [5]},
|
161
|
+
366 => {'Length'=>[30] * 12 + [6]}
|
162
|
+
}
|
163
|
+
}]
|
164
|
+
|
165
|
+
#
|
166
|
+
# Borji Calendar
|
167
|
+
#
|
168
|
+
Borji = [EphemerisBasedSolar, {
|
169
|
+
'label' => 'Iranian::Borji',
|
170
|
+
'indices' => _indicesS,
|
171
|
+
'origin_of_MSC' => -621,
|
172
|
+
'epoch_in_CE' => 621,
|
173
|
+
'cycle_offset' => 0,
|
174
|
+
'time_basis' => '+15:30'
|
175
|
+
}]
|
176
|
+
|
177
|
+
#
|
178
|
+
# Table Based Borji Calendar
|
179
|
+
#
|
180
|
+
TableBasedBorji = [PatternTableBasedSolar, {
|
181
|
+
'label' => 'Iranian::SolarHijri (Combined)',
|
182
|
+
'indices' => _indicesM,
|
183
|
+
'origin_of_MSC' => 1230,
|
184
|
+
'origin_of_LSC' => 2397203,
|
185
|
+
'epoch_in_CE' => 621,
|
186
|
+
'before' => 'Borji',
|
187
|
+
'after' => 'SolarHijriAlgorithmic',
|
188
|
+
'rule_table'=> %w(
|
189
|
+
112111000900 011211000900 012111190900 111121009090 111211000900
|
190
|
+
011211000900 012111190900 111120109090 111211009000 011211000900
|
191
|
+
012111190900 021120109090 111211009090 111211000900 012111190900
|
192
|
+
012120109090 111211009090 111211000900 012111190900 012120109090
|
193
|
+
111121009090 111211000900 012111000900 012111109090 111121009090
|
194
|
+
111211000900 011211000900 012111109090 111121009090 111211000900
|
195
|
+
011211000900 012111109900 111121009090 111211000900 011211000900
|
196
|
+
012111109900 111121009090 111211000900 011211000900 012111190900
|
197
|
+
111120109090 111211009000 011211000900 012111190900 012120109090
|
198
|
+
111211009090 111211000900 012111190900 012120109090 111121009090
|
199
|
+
111211000900 012111190900 012111109090 111121009090 111211000900
|
200
|
+
011211000900 012111109090 111121009090 111211000900 011211000900
|
201
|
+
012111109090 111121009090 111211000900 011211000900 012111109090
|
202
|
+
111121009090 111211000900 011211000900 012111109900 111120109090
|
203
|
+
111211000900 011211000900 012111190900 012120109090)
|
204
|
+
}]
|
205
|
+
end
|
206
|
+
end
|