Class: DateTime::Fixed360Day

Inherits:
DateTimeLike show all
Extended by:
DateTimeLikeExtension
Defined in:
lib/timesteps/datetime_360day.rb,
lib/timesteps/datetime_timestep.rb

Overview

datetime class represents ‘360_day` calendar

Constant Summary collapse

DPY =

Number of days per year

360
DPM =

Numbers of days per months

[0,30,30,30,30,30,30,30,30,30,30,30,30]
UNIX_EPOCH_IN_AJD =

Astronomical Julian day number of UNIX epoch

Rational(4811039,2)

Instance Attribute Summary

Attributes inherited from DateTimeLike

#day, #hour, #minute, #month, #offset, #year

Instance Method Summary collapse

Methods inherited from DateTimeLike

#+, #-, #<<, #<=>, #>>, #ajd, #compare_d, #compare_md, #difference_in_months, #difference_in_years, #fraction, #initialize, #inspect, #jd, #new_offset, #next_day, #next_month, #next_year, #prev_day, #prev_month, #prev_year, #second, #second_fraction, #strftime, #succ, #to_s, #wday, #yday

Constructor Details

This class inherits a constructor from DateTimeLike

Instance Method Details

#leap?Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


31
32
33
# File 'lib/timesteps/datetime_360day.rb', line 31

def leap?
  raise NotImplementedError
end

#timeperiod(interval_spec, tz: nil, ends: "[]") ⇒ Object



88
89
90
# File 'lib/timesteps/datetime_timestep.rb', line 88

def timeperiod (interval_spec, tz: nil, ends: "[]")
  return TimePeriod.new(interval_spec, since: self, calendar: "360day", ends: ends, tz: tz)
end

#timestep(interval_spec, tz: nil) ⇒ Object



84
85
86
# File 'lib/timesteps/datetime_timestep.rb', line 84

def timestep (interval_spec, tz: nil)
  return TimeStep.new(interval_spec, since: self, clanedar: "360day", tz: tz)
end