method
_parse_ddd
v1_8_6_287 -
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?
_parse_ddd(str, e)
private
Hide source
# File lib/date/format.rb, line 887 def self._parse_ddd(str, e) # :nodoc: if str.sub!( /([-+]?)(\d{2,14}) (?: \s* T? \s* (\d{2,6})(?:[,.](\d*))? )? (?: \s* ( Z | [-+]\d{1,4} ) \b )? /inx, ' ') case $2.size when 2 e.mday = $2[ 0, 2].to_i when 4 e.mon = $2[ 0, 2].to_i e.mday = $2[ 2, 2].to_i when 6 e.year = ($1 + $2[ 0, 2]).to_i e.mon = $2[ 2, 2].to_i e.mday = $2[ 4, 2].to_i when 8, 10, 12, 14 e.year = ($1 + $2[ 0, 4]).to_i e.mon = $2[ 4, 2].to_i e.mday = $2[ 6, 2].to_i e.hour = $2[ 8, 2].to_i if $2.size >= 10 e.min = $2[10, 2].to_i if $2.size >= 12 e.sec = $2[12, 2].to_i if $2.size >= 14 e._comp = false when 3 e.yday = $2[ 0, 3].to_i when 5 e.year = ($1 + $2[ 0, 2]).to_i e.yday = $2[ 2, 3].to_i when 7 e.year = ($1 + $2[ 0, 4]).to_i e.yday = $2[ 4, 3].to_i end if $3 case $3.size when 2, 4, 6 e.hour = $3[ 0, 2].to_i e.min = $3[ 2, 2].to_i if $3.size >= 4 e.sec = $3[ 4, 2].to_i if $3.size >= 6 end end if $4 e.sec_fraction = $4.to_i.to_r / (10**$4.size) end if $5 e.zone = $5 end true end end