hijri_umm_alqura 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NDM4OTI4ZGJlNTNhZjBkZDdhZWI4OWNkZDQ3ZWFjNTk2MmY0MTVjZQ==
5
+ data.tar.gz: !binary |-
6
+ ODY2YTg5MDcyMjlkZmZjMGUwZjU0Njc1Mjk0OTgyZGZlZGNhMmVjNg==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ YzUyMDI2ZmI4OGE4MTE0MTljZDFkZTQ2ODhlMWE3OGU2Y2E1ZDNmYWRjNGI1
10
+ YzhhNGJkMWI3YjE1ZDkyOGVhNjI0OGVhNjE0MmVlNTcxODhhZGM1NWE0ODRh
11
+ NmFiMDI1NDZiZDMzOGJmMmMxZTdiZTNlM2I3YjNmNWExYjVhZmY=
12
+ data.tar.gz: !binary |-
13
+ NDQyMDRmZTc5YjQwYTM1MjA2YTA2OGU3ODdhNmVlYjdmN2IwOWEwMmJlNzU3
14
+ ZDMyMGQ3MDk4NjQ4ZmYzNThlNWNjNWExZGQzMzhmY2RjMjhiYzJjZWRmYzQ5
15
+ ZWU5YmFiYjgyNDQyMTkzZjE5NDNiNjVkMTM3MGI2YTI2YTVhYmM=
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in hijri.gemspec
4
+ gemspec
data/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # Hijri UmmAlqura
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'hijri_umm_alqura'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install hijri_umm_alqura
18
+
19
+ ## Usage
20
+
21
+ TODO: Write usage instructions here
22
+
23
+ ## Contributing
24
+
25
+ 1. Fork it
26
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
27
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
28
+ 4. Push to the branch (`git push origin my-new-feature`)
29
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,9 @@
1
+ require "bundler/gem_tasks"
2
+ require "rake/testtask"
3
+
4
+ Rake::TestTask.new do |t|
5
+ t.libs << 'lib/hijri_umm_alqura'
6
+ t.test_files = FileList['test/*_test.rb']
7
+ end
8
+
9
+ task :default => :test
@@ -0,0 +1,274 @@
1
+ # -*- coding: utf-8 -*-
2
+
3
+ # implimintation of UmmAlQura calendar
4
+ # by Mohammed Alsheikh December 2013.
5
+
6
+ # Thanks for Keith Wood who implemented UmmAlQura calendar in javascript.
7
+ # keith-wood.name
8
+ # Many thanks for Murtaza Gulamali for his work in hijri date gem, I really inspired by your work.
9
+ # https://github.com/mygulamali/hijri_date
10
+
11
+ require "date"
12
+ require "hijri_umm_alqura/constants"
13
+
14
+ module HijriUmmAlqura
15
+ # Hijri class implementation
16
+ class Hijri
17
+
18
+ attr_accessor :year, :month, :day
19
+
20
+ # constructor
21
+ def initialize(year = 1435, month = 1 , day = 1)
22
+ @year = year
23
+ @month = month
24
+ @day = day
25
+ end
26
+
27
+ # return hijri date with month and day names
28
+ def to_s
29
+ today = arabno_to_hindi(day) + " "
30
+ today = today + HijriUmmAlqura::MONTHNAMES[month] + " "
31
+ today = today + arabno_to_hindi(year) + " هـ"
32
+ end
33
+
34
+ # Hijri to julian
35
+ def jd(date = self)
36
+ index = (12 * (date.year - 1)) + date.month - 16260
37
+ mcjdn = date.day + HijriUmmAlqura::UMMALQURA_DAT[index - 1] - 1
38
+ mcjdn = mcjdn + 2400000 - 0.5
39
+ return mcjdn
40
+ end
41
+
42
+ # Hijri to gregorian
43
+ def gd(date = self)
44
+ j_date = jd(date)
45
+ g_date = HijriUmmAlqura.jd_to_gd(j_date)
46
+ return g_date
47
+ end
48
+
49
+ # Add Days - Weeks - Months - Years
50
+ def add(date = self, offset, period)
51
+ y = period == 'y' ? (date.year + offset) : date.year
52
+ m = period == 'm' ? (month_of_year(date.year, date.month) + offset) : month_of_year(date.year, date.month)
53
+ d = date.day
54
+ begin
55
+ if (period == 'd' || period == 'w')
56
+ week_days = period == 'w' ? 7 : 1
57
+ j_date = jd
58
+ j_date = j_date + offset * week_days
59
+ result = HijriUmmAlqura.jd(j_date)
60
+ return result
61
+ elsif (period == 'm')
62
+ rys = resync_year_month(y, m)
63
+ y = rys[0]
64
+ m = rys[1]
65
+ return HijriUmmAlqura.format_date([y, m, d])
66
+ elsif (period == 'y')
67
+ return HijriUmmAlqura.format_date([y, m, d])
68
+ end
69
+ rescue Exception => e
70
+ puts "Exception details: #{e.class} #{e.message}"
71
+ end
72
+ end
73
+
74
+ def resync_year_month(y, m)
75
+ if m < 1
76
+ while (m < 1)
77
+ y = y - 1
78
+ m += months_in_year
79
+ end
80
+ else
81
+ year_months = months_in_year
82
+ while (m > year_months - 1 + 1)
83
+ y = y + 1
84
+ m -= year_months
85
+ year_months = months_in_year
86
+ end
87
+ end
88
+
89
+ return [y,m]
90
+ end
91
+
92
+ def month_of_year(year,month)
93
+ return (month + months_in_year - 1) % months_in_year + 1
94
+ end
95
+
96
+ def months_in_year
97
+ return 12
98
+ end
99
+
100
+ def days_in_month
101
+ mcjdn = jd - 2400000 + 0.5
102
+ index = 0
103
+ for i in 0..HijriUmmAlqura::UMMALQURA_DAT.length
104
+ if HijriUmmAlqura::UMMALQURA_DAT[i] && (HijriUmmAlqura::UMMALQURA_DAT[i] > mcjdn)
105
+ return (HijriUmmAlqura::UMMALQURA_DAT[index] - HijriUmmAlqura::UMMALQURA_DAT[index - 1])
106
+ end
107
+ i+=1
108
+ index+=1
109
+ end
110
+ return 30
111
+ end
112
+
113
+ # comparison operator
114
+ def == (date)
115
+ if date.is_a?(HijriUmmAlqura::Hijri)
116
+ if date.year == self.year and date.month == self.month and date.day == self.day
117
+ return true
118
+ end
119
+ return false
120
+ end
121
+ raise TypeError, 'expected HijriDate::Date'
122
+ end
123
+
124
+ # return hijri date plus n days
125
+ def + (n)
126
+ case n
127
+ when Numeric then
128
+ j_date = jd + n * 1
129
+ result = HijriUmmAlqura.jd(j_date)
130
+ return result
131
+ end
132
+ raise TypeError, 'expected numeric'
133
+ end
134
+
135
+ # return hijri date minus n days
136
+ def - (n)
137
+ case n
138
+ when Numeric then
139
+ j_date = jd - n * 1
140
+ result = HijriUmmAlqura.jd(j_date)
141
+ return result
142
+ end
143
+ raise TypeError, 'expected numeric'
144
+ end
145
+
146
+ # Convert arabic numbers to hindi numbers
147
+ def arabno_to_hindi(input)
148
+ arabic_to_hindi = {
149
+ '9' => '٩',
150
+ '8' => '٨',
151
+ '7' => '٧',
152
+ '6' => '٦',
153
+ '5' => '٥',
154
+ '4' => '٤',
155
+ '3' => '٣',
156
+ '2' => '٢',
157
+ '1' => '١',
158
+ '0' => '٠'
159
+ }
160
+ text = ""
161
+ input = input.to_s.split("")
162
+ input.each do |i|
163
+ text+= arabic_to_hindi[i]
164
+ end
165
+ text
166
+ end
167
+ end
168
+
169
+ #-------------------------------------------------------------------
170
+ # MODULE METHODS
171
+
172
+ # Format date to yyyy-mm-dd
173
+ def HijriUmmAlqura.format_date(input)
174
+ today = input[0].to_s + "-" + (input[1].to_s).to_s.rjust(2,'0') + "-" + (input[2].to_s).to_s.rjust(2,'0')
175
+ end
176
+
177
+ # julian to hijri
178
+ def HijriUmmAlqura.jd(jd = 2456641.5)
179
+ mcjdn = jd - 2400000 + 0.5
180
+ index = 0
181
+ i = 0
182
+
183
+ for i in 0..HijriUmmAlqura::UMMALQURA_DAT.length
184
+ break if (HijriUmmAlqura::UMMALQURA_DAT[i] > mcjdn)
185
+ i+=1
186
+ index+=1
187
+ end
188
+
189
+ lunation = index + 16260
190
+ ii = ((lunation - 1) / 12).floor
191
+ year = ii + 1
192
+ month = lunation - 12 * ii
193
+ day = (mcjdn - HijriUmmAlqura::UMMALQURA_DAT[index - 1] + 1).to_i
194
+ h_date = HijriUmmAlqura.format_date([year, month, day])
195
+ return h_date
196
+ end
197
+
198
+ # gregorian to julian
199
+ def HijriUmmAlqura.gd_to_jd(year, month, day)
200
+ year = 1 if year < 0
201
+ if ( month < 3 )
202
+ month = month + 12
203
+ year = year - 1
204
+ end
205
+ a = (year / 100).floor
206
+ b = 2 - a + (a / 4).floor
207
+ return (365.25 * (year + 4716)).floor + (30.6001 * (month + 1)).floor + day + b - 1524.5
208
+ end
209
+
210
+ # Julian to gregorian
211
+ def HijriUmmAlqura.jd_to_gd(jd)
212
+ z = (jd + 0.5).floor
213
+ a = ((z - 1867216.25) / 36524.25).floor
214
+ a = z + 1 + a -(a / 4).floor
215
+ b = a + 1524
216
+ c = ((b - 122.1) / 365.25).floor
217
+ d = (365.25 * c).floor
218
+ e = ((b - d) / 30.6001).floor
219
+ day = b - d - (e * 30.6001).floor
220
+ month = e - (e > 13.5 ? 13 : 1)
221
+ year = c - (month > 2.5 ? 4716 : 4715)
222
+ year = 1 if year <= 0
223
+ g_date = HijriUmmAlqura.format_date([year, month, day])
224
+ return g_date
225
+ end
226
+
227
+ # hijri to gregorian
228
+ def HijriUmmAlqura.hd_to_gd(year, month, day)
229
+ begin
230
+ h_date = HijriUmmAlqura::Hijri.new(year, month, day)
231
+ g_date = h_date.gd.split('-')
232
+ g_date = HijriUmmAlqura.format_date(g_date)
233
+ rescue ArgumentError
234
+ raise ArgumentError.new("Only numbers are allowed")
235
+ end
236
+ return g_date
237
+ end
238
+
239
+ # Hijri to julian
240
+ def HijriUmmAlqura.hd_to_jd(year, month, day)
241
+ index = (12 * (year - 1)) + month - 16260
242
+ mcjdn = day + HijriUmmAlqura::UMMALQURA_DAT[index - 1] - 1
243
+ mcjdn = mcjdn + 2400000 - 0.5
244
+ return mcjdn
245
+ end
246
+
247
+ # Gregorian to hijri
248
+ def HijriUmmAlqura.gd_to_hd(year, month, day)
249
+ begin
250
+ j_date = HijriUmmAlqura.gd_to_jd(year,month,day)
251
+ h_date = HijriUmmAlqura.jd(j_date)
252
+ rescue ArgumentError
253
+ raise ArgumentError.new("Only numbers are allowed")
254
+ end
255
+ return h_date
256
+ end
257
+
258
+ # Days in month
259
+ def HijriUmmAlqura.days_in_month(year, month, day)
260
+ jd = HijriUmmAlqura.hd_to_jd(year, month, day)
261
+ mcjdn = jd - 2400000 + 0.5
262
+ index = 0
263
+
264
+ for i in 0..HijriUmmAlqura::UMMALQURA_DAT.length
265
+ if HijriUmmAlqura::UMMALQURA_DAT[i] && (HijriUmmAlqura::UMMALQURA_DAT[i] > mcjdn)
266
+ return (HijriUmmAlqura::UMMALQURA_DAT[index] - HijriUmmAlqura::UMMALQURA_DAT[index - 1])
267
+ end
268
+ i+=1
269
+ index+=1
270
+ end
271
+
272
+ return 30
273
+ end
274
+ end
@@ -0,0 +1,121 @@
1
+ # -*- coding: utf-8 -*-
2
+ module HijriUmmAlqura
3
+
4
+ UMMALQURA_DAT = [
5
+ 28607, 28636, 28665, 28695, 28724, 28754, 28783, 28813, 28843, 28872, 28901, 28931, 28960, 28990, 29019, 29049, 29078, 29108, 29137, 29167,
6
+ 29196, 29226, 29255, 29285, 29315, 29345, 29375, 29404, 29434, 29463, 29492, 29522, 29551, 29580, 29610, 29640, 29669, 29699, 29729, 29759,
7
+ 29788, 29818, 29847, 29876, 29906, 29935, 29964, 29994, 30023, 30053, 30082, 30112, 30141, 30171, 30200, 30230, 30259, 30289, 30318, 30348,
8
+ 30378, 30408, 30437, 30467, 30496, 30526, 30555, 30585, 30614, 30644, 30673, 30703, 30732, 30762, 30791, 30821, 30850, 30880, 30909, 30939,
9
+ 30968, 30998, 31027, 31057, 31086, 31116, 31145, 31175, 31204, 31234, 31263, 31293, 31322, 31352, 31381, 31411, 31441, 31471, 31500, 31530,
10
+ 31559, 31589, 31618, 31648, 31676, 31706, 31736, 31766, 31795, 31825, 31854, 31884, 31913, 31943, 31972, 32002, 32031, 32061, 32090, 32120,
11
+ 32150, 32180, 32209, 32239, 32268, 32298, 32327, 32357, 32386, 32416, 32445, 32475, 32504, 32534, 32563, 32593, 32622, 32652, 32681, 32711,
12
+ 32740, 32770, 32799, 32829, 32858, 32888, 32917, 32947, 32976, 33006, 33035, 33065, 33094, 33124, 33153, 33183, 33213, 33243, 33272, 33302,
13
+ 33331, 33361, 33390, 33420, 33450, 33479, 33509, 33539, 33568, 33598, 33627, 33657, 33686, 33716, 33745, 33775, 33804, 33834, 33863, 33893,
14
+ 33922, 33952, 33981, 34011, 34040, 34069, 34099, 34128, 34158, 34187, 34217, 34247, 34277, 34306, 34336, 34365, 34395, 34424, 34454, 34483,
15
+ 34512, 34542, 34571, 34601, 34631, 34660, 34690, 34719, 34749, 34778, 34808, 34837, 34867, 34896, 34926, 34955, 34985, 35015, 35044, 35074,
16
+ 35103, 35133, 35162, 35192, 35222, 35251, 35280, 35310, 35340, 35370, 35399, 35429, 35458, 35488, 35517, 35547, 35576, 35605, 35635, 35665,
17
+ 35694, 35723, 35753, 35782, 35811, 35841, 35871, 35901, 35930, 35960, 35989, 36019, 36048, 36078, 36107, 36136, 36166, 36195, 36225, 36254,
18
+ 36284, 36314, 36343, 36373, 36403, 36433, 36462, 36492, 36521, 36551, 36580, 36610, 36639, 36669, 36698, 36728, 36757, 36786, 36816, 36845,
19
+ 36875, 36904, 36934, 36963, 36993, 37022, 37052, 37081, 37111, 37141, 37170, 37200, 37229, 37259, 37288, 37318, 37347, 37377, 37406, 37436,
20
+ 37465, 37495, 37524, 37554, 37584, 37613, 37643, 37672, 37701, 37731, 37760, 37790, 37819, 37849, 37878, 37908, 37938, 37967, 37997, 38027,
21
+ 38056, 38085, 38115, 38144, 38174, 38203, 38233, 38262, 38292, 38322, 38351, 38381, 38410, 38440, 38469, 38499, 38528, 38558, 38587, 38617,
22
+ 38646, 38676, 38705, 38735, 38764, 38794, 38823, 38853, 38882, 38912, 38941, 38971, 39001, 39030, 39059, 39089, 39118, 39148, 39178, 39208,
23
+ 39237, 39267, 39297, 39326, 39355, 39385, 39414, 39444, 39473, 39503, 39532, 39562, 39592, 39621, 39650, 39680, 39709, 39739, 39768, 39798,
24
+ 39827, 39857, 39886, 39916, 39946, 39975, 40005, 40035, 40064, 40094, 40123, 40153, 40182, 40212, 40241, 40271, 40300, 40330, 40359, 40389,
25
+ 40418, 40448, 40477, 40507, 40536, 40566, 40595, 40625, 40655, 40685, 40714, 40744, 40773, 40803, 40832, 40862, 40892, 40921, 40951, 40980,
26
+ 41009, 41039, 41068, 41098, 41127, 41157, 41186, 41216, 41245, 41275, 41304, 41334, 41364, 41393, 41422, 41452, 41481, 41511, 41540, 41570,
27
+ 41599, 41629, 41658, 41688, 41718, 41748, 41777, 41807, 41836, 41865, 41894, 41924, 41953, 41983, 42012, 42042, 42072, 42102, 42131, 42161,
28
+ 42190, 42220, 42249, 42279, 42308, 42337, 42367, 42397, 42426, 42456, 42485, 42515, 42545, 42574, 42604, 42633, 42662, 42692, 42721, 42751,
29
+ 42780, 42810, 42839, 42869, 42899, 42929, 42958, 42988, 43017, 43046, 43076, 43105, 43135, 43164, 43194, 43223, 43253, 43283, 43312, 43342,
30
+ 43371, 43401, 43430, 43460, 43489, 43519, 43548, 43578, 43607, 43637, 43666, 43696, 43726, 43755, 43785, 43814, 43844, 43873, 43903, 43932,
31
+ 43962, 43991, 44021, 44050, 44080, 44109, 44139, 44169, 44198, 44228, 44258, 44287, 44317, 44346, 44375, 44405, 44434, 44464, 44493, 44523,
32
+ 44553, 44582, 44612, 44641, 44671, 44700, 44730, 44759, 44788, 44818, 44847, 44877, 44906, 44936, 44966, 44996, 45025, 45055, 45084, 45114,
33
+ 45143, 45172, 45202, 45231, 45261, 45290, 45320, 45350, 45380, 45409, 45439, 45468, 45498, 45527, 45556, 45586, 45615, 45644, 45674, 45704,
34
+ 45733, 45763, 45793, 45823, 45852, 45882, 45911, 45940, 45970, 45999, 46028, 46058, 46088, 46117, 46147, 46177, 46206, 46236, 46265, 46295,
35
+ 46324, 46354, 46383, 46413, 46442, 46472, 46501, 46531, 46560, 46590, 46620, 46649, 46679, 46708, 46738, 46767, 46797, 46826, 46856, 46885,
36
+ 46915, 46944, 46974, 47003, 47033, 47063, 47092, 47122, 47151, 47181, 47210, 47240, 47269, 47298, 47328, 47357, 47387, 47417, 47446, 47476,
37
+ 47506, 47535, 47565, 47594, 47624, 47653, 47682, 47712, 47741, 47771, 47800, 47830, 47860, 47890, 47919, 47949, 47978, 48008, 48037, 48066,
38
+ 48096, 48125, 48155, 48184, 48214, 48244, 48273, 48303, 48333, 48362, 48392, 48421, 48450, 48480, 48509, 48538, 48568, 48598, 48627, 48657,
39
+ 48687, 48717, 48746, 48776, 48805, 48834, 48864, 48893, 48922, 48952, 48982, 49011, 49041, 49071, 49100, 49130, 49160, 49189, 49218, 49248,
40
+ 49277, 49306, 49336, 49365, 49395, 49425, 49455, 49484, 49514, 49543, 49573, 49602, 49632, 49661, 49690, 49720, 49749, 49779, 49809, 49838,
41
+ 49868, 49898, 49927, 49957, 49986, 50016, 50045, 50075, 50104, 50133, 50163, 50192, 50222, 50252, 50281, 50311, 50340, 50370, 50400, 50429,
42
+ 50459, 50488, 50518, 50547, 50576, 50606, 50635, 50665, 50694, 50724, 50754, 50784, 50813, 50843, 50872, 50902, 50931, 50960, 50990, 51019,
43
+ 51049, 51078, 51108, 51138, 51167, 51197, 51227, 51256, 51286, 51315, 51345, 51374, 51403, 51433, 51462, 51492, 51522, 51552, 51582, 51611,
44
+ 51641, 51670, 51699, 51729, 51758, 51787, 51816, 51846, 51876, 51906, 51936, 51965, 51995, 52025, 52054, 52083, 52113, 52142, 52171, 52200,
45
+ 52230, 52260, 52290, 52319, 52349, 52379, 52408, 52438, 52467, 52497, 52526, 52555, 52585, 52614, 52644, 52673, 52703, 52733, 52762, 52792,
46
+ 52822, 52851, 52881, 52910, 52939, 52969, 52998, 53028, 53057, 53087, 53116, 53146, 53176, 53205, 53235, 53264, 53294, 53324, 53353, 53383,
47
+ 53412, 53441, 53471, 53500, 53530, 53559, 53589, 53619, 53648, 53678, 53708, 53737, 53767, 53796, 53825, 53855, 53884, 53913, 53943, 53973,
48
+ 54003, 54032, 54062, 54092, 54121, 54151, 54180, 54209, 54239, 54268, 54297, 54327, 54357, 54387, 54416, 54446, 54476, 54505, 54535, 54564,
49
+ 54593, 54623, 54652, 54681, 54711, 54741, 54770, 54800, 54830, 54859, 54889, 54919, 54948, 54977, 55007, 55036, 55066, 55095, 55125, 55154,
50
+ 55184, 55213, 55243, 55273, 55302, 55332, 55361, 55391, 55420, 55450, 55479, 55508, 55538, 55567, 55597, 55627, 55657, 55686, 55716, 55745,
51
+ 55775, 55804, 55834, 55863, 55892, 55922, 55951, 55981, 56011, 56040, 56070, 56100, 56129, 56159, 56188, 56218, 56247, 56276, 56306, 56335,
52
+ 56365, 56394, 56424, 56454, 56483, 56513, 56543, 56572, 56601, 56631, 56660, 56690, 56719, 56749, 56778, 56808, 56837, 56867, 56897, 56926,
53
+ 56956, 56985, 57015, 57044, 57074, 57103, 57133, 57162, 57192, 57221, 57251, 57280, 57310, 57340, 57369, 57399, 57429, 57458, 57487, 57517,
54
+ 57546, 57576, 57605, 57634, 57664, 57694, 57723, 57753, 57783, 57813, 57842, 57871, 57901, 57930, 57959, 57989, 58018, 58048, 58077, 58107,
55
+ 58137, 58167, 58196, 58226, 58255, 58285, 58314, 58343, 58373, 58402, 58432, 58461, 58491, 58521, 58551, 58580, 58610, 58639, 58669, 58698,
56
+ 58727, 58757, 58786, 58816, 58845, 58875, 58905, 58934, 58964, 58994, 59023, 59053, 59082, 59111, 59141, 59170, 59200, 59229, 59259, 59288,
57
+ 59318, 59348, 59377, 59407, 59436, 59466, 59495, 59525, 59554, 59584, 59613, 59643, 59672, 59702, 59731, 59761, 59791, 59820, 59850, 59879,
58
+ 59909, 59939, 59968, 59997, 60027, 60056, 60086, 60115, 60145, 60174, 60204, 60234, 60264, 60293, 60323, 60352, 60381, 60411, 60440, 60469,
59
+ 60499, 60528, 60558, 60588, 60618, 60648, 60677, 60707, 60736, 60765, 60795, 60824, 60853, 60883, 60912, 60942, 60972, 61002, 61031, 61061,
60
+ 61090, 61120, 61149, 61179, 61208, 61237, 61267, 61296, 61326, 61356, 61385, 61415, 61445, 61474, 61504, 61533, 61563, 61592, 61621, 61651,
61
+ 61680, 61710, 61739, 61769, 61799, 61828, 61858, 61888, 61917, 61947, 61976, 62006, 62035, 62064, 62094, 62123, 62153, 62182, 62212, 62242,
62
+ 62271, 62301, 62331, 62360, 62390, 62419, 62448, 62478, 62507, 62537, 62566, 62596, 62625, 62655, 62685, 62715, 62744, 62774, 62803, 62832,
63
+ 62862, 62891, 62921, 62950, 62980, 63009, 63039, 63069, 63099, 63128, 63157, 63187, 63216, 63246, 63275, 63305, 63334, 63363, 63393, 63423,
64
+ 63453, 63482, 63512, 63541, 63571, 63600, 63630, 63659, 63689, 63718, 63747, 63777, 63807, 63836, 63866, 63895, 63925, 63955, 63984, 64014,
65
+ 64043, 64073, 64102, 64131, 64161, 64190, 64220, 64249, 64279, 64309, 64339, 64368, 64398, 64427, 64457, 64486, 64515, 64545, 64574, 64603,
66
+ 64633, 64663, 64692, 64722, 64752, 64782, 64811, 64841, 64870, 64899, 64929, 64958, 64987, 65017, 65047, 65076, 65106, 65136, 65166, 65195,
67
+ 65225, 65254, 65283, 65313, 65342, 65371, 65401, 65431, 65460, 65490, 65520, 65549, 65579, 65608, 65638, 65667, 65697, 65726, 65755, 65785,
68
+ 65815, 65844, 65874, 65903, 65933, 65963, 65992, 66022, 66051, 66081, 66110, 66140, 66169, 66199, 66228, 66258, 66287, 66317, 66346, 66376,
69
+ 66405, 66435, 66465, 66494, 66524, 66553, 66583, 66612, 66641, 66671, 66700, 66730, 66760, 66789, 66819, 66849, 66878, 66908, 66937, 66967,
70
+ 66996, 67025, 67055, 67084, 67114, 67143, 67173, 67203, 67233, 67262, 67292, 67321, 67351, 67380, 67409, 67439, 67468, 67497, 67527, 67557,
71
+ 67587, 67617, 67646, 67676, 67705, 67735, 67764, 67793, 67823, 67852, 67882, 67911, 67941, 67971, 68000, 68030, 68060, 68089, 68119, 68148,
72
+ 68177, 68207, 68236, 68266, 68295, 68325, 68354, 68384, 68414, 68443, 68473, 68502, 68532, 68561, 68591, 68620, 68650, 68679, 68708, 68738,
73
+ 68768, 68797, 68827, 68857, 68886, 68916, 68946, 68975, 69004, 69034, 69063, 69092, 69122, 69152, 69181, 69211, 69240, 69270, 69300, 69330,
74
+ 69359, 69388, 69418, 69447, 69476, 69506, 69535, 69565, 69595, 69624, 69654, 69684, 69713, 69743, 69772, 69802, 69831, 69861, 69890, 69919,
75
+ 69949, 69978, 70008, 70038, 70067, 70097, 70126, 70156, 70186, 70215, 70245, 70274, 70303, 70333, 70362, 70392, 70421, 70451, 70481, 70510,
76
+ 70540, 70570, 70599, 70629, 70658, 70687, 70717, 70746, 70776, 70805, 70835, 70864, 70894, 70924, 70954, 70983, 71013, 71042, 71071, 71101,
77
+ 71130, 71159, 71189, 71218, 71248, 71278, 71308, 71337, 71367, 71397, 71426, 71455, 71485, 71514, 71543, 71573, 71602, 71632, 71662, 71691,
78
+ 71721, 71751, 71781, 71810, 71839, 71869, 71898, 71927, 71957, 71986, 72016, 72046, 72075, 72105, 72135, 72164, 72194, 72223, 72253, 72282,
79
+ 72311, 72341, 72370, 72400, 72429, 72459, 72489, 72518, 72548, 72577, 72607, 72637, 72666, 72695, 72725, 72754, 72784, 72813, 72843, 72872,
80
+ 72902, 72931, 72961, 72991, 73020, 73050, 73080, 73109, 73139, 73168, 73197, 73227, 73256, 73286, 73315, 73345, 73375, 73404, 73434, 73464,
81
+ 73493, 73523, 73552, 73581, 73611, 73640, 73669, 73699, 73729, 73758, 73788, 73818, 73848, 73877, 73907, 73936, 73965, 73995, 74024, 74053,
82
+ 74083, 74113, 74142, 74172, 74202, 74231, 74261, 74291, 74320, 74349, 74379, 74408, 74437, 74467, 74497, 74526, 74556, 74586, 74615, 74645,
83
+ 74675, 74704, 74733, 74763, 74792, 74822, 74851, 74881, 74910, 74940, 74969, 74999, 75029, 75058, 75088, 75117, 75147, 75176, 75206, 75235,
84
+ 75264, 75294, 75323, 75353, 75383, 75412, 75442, 75472, 75501, 75531, 75560, 75590, 75619, 75648, 75678, 75707, 75737, 75766, 75796, 75826,
85
+ 75856, 75885, 75915, 75944, 75974, 76003, 76032, 76062, 76091, 76121, 76150, 76180, 76210, 76239, 76269, 76299, 76328, 76358, 76387, 76416,
86
+ 76446, 76475, 76505, 76534, 76564, 76593, 76623, 76653, 76682, 76712, 76741, 76771, 76801, 76830, 76859, 76889, 76918, 76948, 76977, 77007,
87
+ 77036, 77066, 77096, 77125, 77155, 77185, 77214, 77243, 77273, 77302, 77332, 77361, 77390, 77420, 77450, 77479, 77509, 77539, 77569, 77598,
88
+ 77627, 77657, 77686, 77715, 77745, 77774, 77804, 77833, 77863, 77893, 77923, 77952, 77982, 78011, 78041, 78070, 78099, 78129, 78158, 78188,
89
+ 78217, 78247, 78277, 78307, 78336, 78366, 78395, 78425, 78454, 78483, 78513, 78542, 78572, 78601, 78631, 78661, 78690, 78720, 78750, 78779,
90
+ 78808, 78838, 78867, 78897, 78926, 78956, 78985, 79015, 79044, 79074, 79104, 79133, 79163, 79192, 79222, 79251, 79281, 79310, 79340, 79369,
91
+ 79399, 79428, 79458, 79487, 79517, 79546, 79576, 79606, 79635, 79665, 79695, 79724, 79753, 79783, 79812, 79841, 79871, 79900, 79930, 79960,
92
+ 79990
93
+ ]
94
+
95
+
96
+ MONTHNAMES = [nil,
97
+ 'محرم',
98
+ 'صفر',
99
+ 'ربيع الأول',
100
+ 'ربيع الثاني',
101
+ 'جمادى الأولى',
102
+ 'جمادى الآخرة',
103
+ 'رجب',
104
+ 'شعبان',
105
+ 'رمضان',
106
+ 'شوال',
107
+ 'ذو القعدة',
108
+ 'ذو الحجة']
109
+
110
+
111
+ DAYNAMES = [
112
+ 'السبت',
113
+ 'الأحد',
114
+ 'الأثنين',
115
+ 'الثلاثاء',
116
+ ' الأربعاء',
117
+ ' الخميس',
118
+ ' الجمعة'
119
+ ]
120
+
121
+ end
@@ -0,0 +1,4 @@
1
+ # -*- coding: utf-8 -*-
2
+ module HijriUmmAlqura
3
+ VERSION = "0.0.1"
4
+ end
metadata ADDED
@@ -0,0 +1,79 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: hijri_umm_alqura
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Mohammed Alsheikh
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-12-18 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.3'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.3'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ! '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ! '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description: Class to convert hijri to/from Julian Date.
42
+ email:
43
+ - msheikh2009@yahoo.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - README.md
49
+ - Gemfile
50
+ - Rakefile
51
+ - lib/hijri_umm_alqura/constants.rb
52
+ - lib/hijri_umm_alqura/version.rb
53
+ - lib/hijri_umm_alqura.rb
54
+ homepage: https://github.com/moh-alsheikh/hijri_ummalqura
55
+ licenses:
56
+ - MIT
57
+ metadata: {}
58
+ post_install_message:
59
+ rdoc_options: []
60
+ require_paths:
61
+ - lib
62
+ required_ruby_version: !ruby/object:Gem::Requirement
63
+ requirements:
64
+ - - ! '>='
65
+ - !ruby/object:Gem::Version
66
+ version: '0'
67
+ required_rubygems_version: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - ! '>='
70
+ - !ruby/object:Gem::Version
71
+ version: '0'
72
+ requirements: []
73
+ rubyforge_project:
74
+ rubygems_version: 2.1.11
75
+ signing_key:
76
+ specification_version: 4
77
+ summary: Hijri Umm Alqura date object
78
+ test_files: []
79
+ has_rdoc: