Skip to content

Commit

Permalink
Lower write version
Browse files Browse the repository at this point in the history
  • Loading branch information
omus committed Jun 17, 2022
1 parent 28970ab commit 4ed324b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/tzfile/TZFile.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ using Dates: Dates, DateTime, Second, datetime2unix, unix2datetime
using ...TimeZones: FixedTimeZone, VariableTimeZone, Transition, isdst

const SUPPORTED_VERSIONS = ('\0', '1', '2', '3', '4')
const LATEST_VERSION = last(SUPPORTED_VERSIONS)

# Writers should generate the lowest version number needed by the data
const WRITE_VERSION = '2'

include("utils.jl")
include("read.jl")
Expand Down
4 changes: 2 additions & 2 deletions src/tzfile/write.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function _combine_designations(abbrs::AbstractVector{<:AbstractString})
return result, indices
end

function write(io::IO, tz::FixedTimeZone; version::Char=LATEST_VERSION)
function write(io::IO, tz::FixedTimeZone; version::Char=WRITE_VERSION)
combined_designation, designation_indices = combine_designations([tz.name])

transition_times = Vector{Int32}()
Expand All @@ -63,7 +63,7 @@ function write(io::IO, tz::FixedTimeZone; version::Char=LATEST_VERSION)
end
end

function write(io::IO, tz::VariableTimeZone; version::Char=LATEST_VERSION)
function write(io::IO, tz::VariableTimeZone; version::Char=WRITE_VERSION)
combined_designation, designation_indices = combine_designations(t.zone.name for t in tz.transitions)

function compatible_transition(t::Transition)
Expand Down

0 comments on commit 4ed324b

Please sign in to comment.