method

new_by_frags

Importance_0
v1_8_6_287 - Show latest stable - 0 notes - Class: DateTime
new_by_frags(elem, sg) 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 1532
  def self.new_by_frags(elem, sg) # :nodoc:
    elem = rewrite_frags(elem)
    elem = complete_frags(elem)
    unless (jd = valid_date_frags?(elem, sg)) &&
           (fr = valid_time_frags?(elem))
      raise ArgumentError, 'invalid date'
    end
    sf = (elem[:sec_fraction] || 0)
    fr += sf/86400
    of = (elem[:offset] || 0)
    of = of.to_r/86400
    new!(jd_to_ajd(jd, fr, of), of, sg)
  end
Register or log in to add new notes.