Skip to content

Commit

Permalink
Update to Dates parsing interface (#134)
Browse files Browse the repository at this point in the history
Change as a part of: JuliaLang/julia#26628
  • Loading branch information
omus authored Apr 14, 2018
1 parent 13de88e commit ce5871e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
18 changes: 15 additions & 3 deletions src/parse.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ function tryparsenext_fixedtz(str, i, len, min_width::Int=1, max_width::Int=0)
end

if tz_end <= min_pos
return nullable(String, nothing), i
return @static if VERSION < v"0.7.0-DEV.4797"
nullable(String, nothing), i
else
nothing
end
else
tz = SubString(str, tz_start, tz_end)
return nullable(String, tz), i
Expand All @@ -55,7 +59,11 @@ function tryparsenext_tz(str, i, len, min_width::Int=1, max_width::Int=0)
end

if tz_end == 0
return nullable(String, nothing), i
return @static if VERSION < v"0.7.0-DEV.4797"
nullable(String, nothing), i
else
nothing
end
else
name = SubString(str, tz_start, tz_end)

Expand All @@ -65,7 +73,11 @@ function tryparsenext_tz(str, i, len, min_width::Int=1, max_width::Int=0)
if occursin("/", name) || name in ("UTC", "GMT")
return nullable(String, name), i
else
return nullable(String, nothing), i
return @static if VERSION < v"0.7.0-DEV.4797"
nullable(String, nothing), i
else
nothing
end
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion test/io.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import TimeZones.TZData: parse_components
using TimeZones.TZData: parse_components

null = FixedTimeZone("", 10800)
fixed = FixedTimeZone("UTC+01:00")
Expand Down

0 comments on commit ce5871e

Please sign in to comment.