Class Index [+]

Quicksearch

When::CalendarTypes::Gregorian

Julian Calendar

Public Instance Methods

_coordinates_to_number(y,m,d) click to toggle source

年月日 -> 通日

  y       - 年
  m       - 月 (0 始まり)
  d       - 日 (0 始まり)

  returns : 通日
     # File when/region/christian.rb, line 109
109:     def _coordinates_to_number(y,m,d)
110:       c = ((m < 2) ? +y-1 : +y).to_i.div(100)
111:       return super - ((3*(c-3)).div(4)+1)
112:     end
_length(date) click to toggle source

暦要素数

  引数パターン1
    date    : [y]
      y     - 年
    returns : 12 (=その年の月数)

  引数パターン2
    date    : [y, m]
      y     - 年
      m     - 月 (0 始まり)
    returns : その年月の日数
     # File when/region/christian.rb, line 142
142:     def _length(date)
143:       yy, mm = date
144:       return 28 if (((yy % 400) != 0) && ((yy % 100) == 0) && (mm == 1))
145:       return super
146:     end
_lunar_equation(year) click to toggle source

太陰方程式

  year      : 西暦の年数

  returns   : Integer
    19年7閏のペースに対する満月の日付の補正量
     # File when/region/christian.rb, line 154
154:     def _lunar_equation(year)
155:       h = +year / 100
156:       -h + h/4 + (8*(h+11))/25 - 3
157:     end
_number_to_coordinates(jdn) click to toggle source

通日 - > 年月日

  jdn     : 通日

  returns : [y, m, d]
    y     - 年
    m     - 月 (0 始まり)
    d     - 日 (0 始まり)
     # File when/region/christian.rb, line 123
123:     def _number_to_coordinates(jdn)
124:       div, mod = (jdn - 77528).divmod(36524.25)
125:       c = div - 45
126:       return super(jdn + ((3*(c-3)).div(4)+1))
127:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.