ethiopic_date 0.0.6 → 0.0.7
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.
- data/lib/ethiopic_date/version.rb +1 -1
- data/lib/ethiopic_date.rb +9 -3
- metadata +1 -1
data/lib/ethiopic_date.rb
CHANGED
|
@@ -26,8 +26,11 @@ module EthiopicDate
|
|
|
26
26
|
#@return GregorianDate is returned
|
|
27
27
|
#@example fromEthiopicToGregorian(2004,5,21)
|
|
28
28
|
|
|
29
|
-
def fromEthiopicToGregorian(
|
|
29
|
+
def fromEthiopicToGregorian(in_date)
|
|
30
30
|
#TODO : Handle Exceptions when there is a wrong input
|
|
31
|
+
year=in_date.year
|
|
32
|
+
month=in_date.month
|
|
33
|
+
day=in_date.day
|
|
31
34
|
if (year <=0)
|
|
32
35
|
era=JD_EPOCH_OFFSET_AMETE_ALEM
|
|
33
36
|
else
|
|
@@ -43,8 +46,11 @@ module EthiopicDate
|
|
|
43
46
|
#@param year,month, day in that order
|
|
44
47
|
#@return EthiopicDate is returned
|
|
45
48
|
#@example fromEthiopicToGregorian(2012,5,21)
|
|
46
|
-
def fromGregorianToEthiopic(
|
|
49
|
+
def fromGregorianToEthiopic(in_date)
|
|
47
50
|
#TODO : Handle Exceptions when there is a wrong input
|
|
51
|
+
year=in_date.year
|
|
52
|
+
month=in_date.month
|
|
53
|
+
day=in_date.day
|
|
48
54
|
date = {:year=>-1,:month=>-1,:day => -1 }
|
|
49
55
|
jdn = jdn_from_gregorian(year,month,day)
|
|
50
56
|
if jdn >=JD_EPOCH_OFFSET_AMETE_MIHRET + 365
|
|
@@ -88,7 +94,7 @@ module EthiopicDate
|
|
|
88
94
|
when 12 then month_name=" ነሃሴ "
|
|
89
95
|
when 13 then month_name=" ጳጉሜን "
|
|
90
96
|
end
|
|
91
|
-
return "#{month_name} #{day} ቀን #{year}ዓ/ም"
|
|
97
|
+
return " #{month_name} #{day} ቀን #{year}ዓ/ም "
|
|
92
98
|
end
|
|
93
99
|
|
|
94
100
|
private
|