class DateTime::Fixed360Day

datetime class represents `360_day` calendar

Constants

DPM

Numbers of days per months

DPY

Number of days per year

UNIX_EPOCH_IN_AJD

Astronomical Julian day number of UNIX epoch

Public Instance Methods

leap?() click to toggle source
# File lib/timesteps/datetime_360day.rb, line 31
def leap?
  raise NotImplementedError
end
timeperiod(interval_spec, tz: nil, ends: "[]") click to toggle source
# File lib/timesteps/datetime_timestep.rb, line 60
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) click to toggle source
# File lib/timesteps/datetime_timestep.rb, line 56
def timestep (interval_spec, tz: nil)
  return TimeStep.new(interval_spec, since: self, clanedar: "360day", tz: tz)
end

Private Instance Methods

valid_date?() click to toggle source
# File lib/timesteps/datetime_360day.rb, line 18
def valid_date?
  if @day >= 31
    return false
  end
  if @month != 2
    return Date.valid_date?(@year, @month, @day)
  else
    return ( @day >= 1 and @day <= 30 )
  end
end