method

valid_weeknum?

Importance_0
v1_8_6_287 - Show latest stable - 0 notes - Class: Date
valid_weeknum?(y, w, d, f, sg=ITALY) private

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/date.rb, line 645
  def self.valid_weeknum? (y, w, d, f, sg=ITALY) # :nodoc:
    if d < 0
      d += 7
    end
    if w < 0
      ny, nw, nd, nf =
        jd_to_weeknum(weeknum_to_jd(y + 1, 1, f, f) + w * 7, f)
      return unless ny == y
      w = nw
    end
    jd = weeknum_to_jd(y, w, d, f)
    return unless gregorian?(jd, sg)
    return unless [y, w, d] == jd_to_weeknum(jd, f)
    jd
  end
Register or log in to add new notes.