def + (n)
raise TypeError, 'expected numeric' unless n.kind_of?(Numeric)
case @date_precision
when YEAR then
return DPrecision::to_p(PDate::civil(year+n,month,day),@date_precision)
when MONTH then
current_date = self.class.to_date(self)
return DPrecision::to_p((current_date>>n),@date_precision)
when WEEK then
return new_self_plus(n*7)
when DAY then
return new_self_plus(n)
when HOUR then
return new_self_plus(n){ |n| n = (n*(1.to_r/24) ) }
when MIN then
return new_self_plus(n){ |n| n = (n*(1.to_r/1440) ) }
when SEC then
return new_self_plus(n){ |n| n = (n*(1.to_r/86400) ) }
when MILLI then
return self
end
end