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.
@@ -1,3 +1,3 @@
1
1
  module EthiopicDate
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
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(year,month,day)
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(year,month,day)
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
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: ethiopic_date
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.6
5
+ version: 0.0.7
6
6
  platform: ruby
7
7
  authors:
8
8
  - G/yohannes Zenebe