Class: When::CalendarTypes::CalendarNote::DarianWeek

Inherits:
CalendarNote::WorldWeek
  • Object
show all
Defined in:
lib/when_exe/region/martian.rb

Overview

Darian Week

Constant Summary collapse

NoteObjects =
[When::BasicTypes::M17n, [
  "namespace:[en=http://en.wikipedia.org/wiki/, ja=http://ja.wikipedia.org/wiki/]",
  "locale:[=en:, ja=ja:, alias]",
  "names:[Darian]",

  # 年の暦注 ----------------------------
  [When::BasicTypes::M17n,
    "names:[year]"
  ],

  # 月の暦注 ----------------------------
  [When::BasicTypes::M17n,
    "names:[month]",
    [When::BasicTypes::M17n,
      "names:[Month]"
    ]
  ],

  # 日の暦注 ----------------------------
  [When::BasicTypes::M17n,
    "names:[day]",
    [When::BasicTypes::M17n,
      "names:[Week]",
      "[Solis,    日曜日]",
      "[Lunae,    月曜日]",
      "[Martis,   火曜日]",
      "[Mercurii, 水曜日]",
      "[Jovis,    木曜日]",
      "[Veneris,  金曜日]",
      "[Saturni,  土曜日]"
    ]
  ]
]]

Instance Method Summary collapse

Instance Method Details

#solis(date, parameter = nil) ⇒ When::TM::TemporalPosition Also known as: week

当日または直前の solis の日


154
155
156
157
158
159
160
161
162
# File 'lib/when_exe/region/martian.rb', line 154

def solis(date, parameter=nil)
  date  = When.Calendar('Darian').jul_trans(date, {:events=>['from_solis']})
  y,m,d = date.cal_date
  dow   = (d-1) % 7
  return date if dow == 0
  date += When::TM::PeriodDuration.new([0,0,-dow])
  date.events = ['from_solis']
  date
end