月日の配当が太陽または月の位置によって決定される暦
Calendar based on the ephemeris of the Sun or the Moon
年月日 -> 通日
y - 年 m - 月 (0 始まり) d - 日 (0 始まり) returns : 通日
# File when/calendartypes.rb, line 563
563: def _coordinates_to_number(y, m, d)
564: _new_epoch(12 * (+y) + m) + d
565: end
暦要素数
引数パターン1
date : [y]
y - 年
returns : その年の月数
引数パターン2
date : [y, m]
y - 年
m - 月 (0 始まり)
returns : その年月の日数
# File when/calendartypes.rb, line 595
595: def _length(date)
596: y, m = date
597: if (m)
598: # 指定した月に含まれる日の数を返します。
599: m += 12 * +y
600: return _new_epoch(m+1) - _new_epoch(m)
601: else
602: # 指定した年に含まれる月の数を返します。
603: return 12
604: end
605: end
月初の通日
m : 通月 returns : 月初の通日
# File when/calendartypes.rb, line 626
626: def _new_epoch_(m)
627: return (@formula[0].cn_to_time(m + @cycle_offset) + 0.5 + @timezone[0]).floor
628: end
通日 - > 年月日
sdn : 通日
returns : [y, m, d]
y - 年
m - 月 (0 始まり)
d - 日 (0 始まり)
# File when/calendartypes.rb, line 576
576: def _number_to_coordinates(sdn)
577: m, d = Residue.mod(sdn) {|m| _new_epoch(m)}
578: y, m = m.divmod(12)
579: return y, m, d
580: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.