hijri_date 1.0.1 → 1.1.0
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 +8 -8
- data/lib/hijri_date/month_names.rb +48 -26
- data/lib/hijri_date/version.rb +1 -1
- data/lib/hijri_date.rb +6 -1
- data/test/hijri_date_test.rb +4 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
!binary "U0hBMQ==":
|
|
3
3
|
metadata.gz: !binary |-
|
|
4
|
-
|
|
4
|
+
MzM5YzdhMWJjNjlmZTM2N2Q2NTIzOGUxMjhkNWQxMjIyY2IzZGI2MA==
|
|
5
5
|
data.tar.gz: !binary |-
|
|
6
|
-
|
|
6
|
+
MDA2NWI5MmU3ODMxNjQ4YWFmYTY3ZGU1N2IxNTEwMTRhYmIxMjllMA==
|
|
7
7
|
!binary "U0hBNTEy":
|
|
8
8
|
metadata.gz: !binary |-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
N2FhNTQwMDdkZGU3MGU0MWFiMjkyMDcwZmYwZmUxNmZmZmFjNmEwMDZmYWI3
|
|
10
|
+
YTQxYzMwYWEyOWE2YzNlM2VkMDZhYjU0MjlhZDg2YTE2NGE2NTlhYWQzYWQ4
|
|
11
|
+
NDQ5NTNhOTNhYzBmMThlNzEzNzY4YzkzNWVkMTBhMGM4NDJlOWY=
|
|
12
12
|
data.tar.gz: !binary |-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
NjJjMDUyMzk4YTIxZTdmNDY1MjE5NjZkMzY0Yjc1Nzk0YmRmN2Q1YWE1NTQ5
|
|
14
|
+
NDlmYmEzOGNmMDgwMzM4YzM0NDNiYjdhN2MxMjg4YzFlZDU5NWZkYTk2Yjc2
|
|
15
|
+
NWNjODZlMGFiNDJlYzNiMTVjNTY0NTNiZGQ3Y2IzMjk0ODllMjU=
|
|
@@ -1,29 +1,51 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
|
|
1
3
|
module HijriDate
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
4
|
+
MONTHNAMES_AR = [
|
|
5
|
+
nil,
|
|
6
|
+
'محرم الحرام',
|
|
7
|
+
'صفر المظفر',
|
|
8
|
+
'ربيع الاول',
|
|
9
|
+
'ربيع الآخر',
|
|
10
|
+
'جمادى الاولى',
|
|
11
|
+
'جمادى الاُخرى',
|
|
12
|
+
'رجب الاصب',
|
|
13
|
+
'شعبان الكريم',
|
|
14
|
+
'رمضان المعظم',
|
|
15
|
+
'شوال المكرم',
|
|
16
|
+
'ذي القعدة الحرام',
|
|
17
|
+
'ذي الحجة الحرام'
|
|
18
|
+
]
|
|
19
|
+
|
|
20
|
+
MONTHNAMES_EN = [
|
|
21
|
+
nil,
|
|
22
|
+
'Moharram al-Haraam',
|
|
23
|
+
'Safar al-Muzaffar',
|
|
24
|
+
'Rabi al-Awwal',
|
|
25
|
+
'Rabi al-Aakhar',
|
|
26
|
+
'Jumada al-Ula',
|
|
27
|
+
'Jumada al-Ukhra',
|
|
28
|
+
'Rajab al-Asab',
|
|
29
|
+
'Shabaan al-Karim',
|
|
30
|
+
'Ramadaan al-Moazzam',
|
|
31
|
+
'Shawwal al-Mukarram',
|
|
32
|
+
'Zilqadah al-Haraam',
|
|
33
|
+
'Zilhaj al-Haraam'
|
|
34
|
+
]
|
|
15
35
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
36
|
+
SHORT_MONTHNAMES_EN = [
|
|
37
|
+
nil,
|
|
38
|
+
'Moharram',
|
|
39
|
+
'Safar',
|
|
40
|
+
'Rabi I',
|
|
41
|
+
'Rabi II',
|
|
42
|
+
'Jumada I',
|
|
43
|
+
'Jumada II',
|
|
44
|
+
'Rajab',
|
|
45
|
+
'Shabaan',
|
|
46
|
+
'Ramadaan',
|
|
47
|
+
'Shawwal',
|
|
48
|
+
'Zilqadah',
|
|
49
|
+
'Zilhaj'
|
|
50
|
+
]
|
|
29
51
|
end
|
data/lib/hijri_date/version.rb
CHANGED
data/lib/hijri_date.rb
CHANGED
|
@@ -16,7 +16,7 @@ module HijriDate
|
|
|
16
16
|
|
|
17
17
|
# convert to string object
|
|
18
18
|
def to_s(date = self)
|
|
19
|
-
return "#{date.day} #{HijriDate::
|
|
19
|
+
return "#{date.day} #{HijriDate::MONTHNAMES_EN[date.month]} #{date.year}H"
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
# is this (or the specified) year a Kabisa year?
|
|
@@ -81,6 +81,11 @@ module HijriDate
|
|
|
81
81
|
end
|
|
82
82
|
raise TypeError, 'expected numeric'
|
|
83
83
|
end
|
|
84
|
+
|
|
85
|
+
# return the day of the week (0-6, Sunday is zero)
|
|
86
|
+
def wday
|
|
87
|
+
Object::Date.jd(self.jd).wday
|
|
88
|
+
end
|
|
84
89
|
end
|
|
85
90
|
|
|
86
91
|
# return new Hijri Date object associated with specified Julian Day number
|
data/test/hijri_date_test.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: hijri_date
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0
|
|
4
|
+
version: 1.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Murtaza Gulamali
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2013-
|
|
11
|
+
date: 2013-11-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|