method
rewrite_frags
v1_9_1_378 -
Show latest stable
-
0 notes -
Class: Date
- 1_8_6_287 (0)
- 1_8_7_72 (0)
- 1_8_7_330 (0)
- 1_9_1_378 (0)
- 1_9_2_180 (0)
- 1_9_3_125
- 1_9_3_392
- 2_1_10
- 2_2_9
- 2_4_6
- 2_5_5
- 2_6_3
- What's this?
rewrite_frags(elem)
private
Hide source
# File lib/date.rb, line 855 def self.rewrite_frags(elem) # :nodoc: elem ||= {} if seconds = elem[:seconds] d, fr = seconds.divmod(86400) h, fr = fr.divmod(3600) min, fr = fr.divmod(60) s, fr = fr.divmod(1) elem[:jd] = UNIX_EPOCH_IN_CJD + d elem[:hour] = h elem[:min] = min elem[:sec] = s elem[:sec_fraction] = fr elem.delete(:seconds) elem.delete(:offset) end elem end