Skip to content

Commit

Permalink
fixed daterange fields' names
Browse files Browse the repository at this point in the history
  • Loading branch information
wildart committed Jun 22, 2022
1 parent 231c7ac commit 666b159
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/DatePickers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ register_normal_element("q__date", context = @__MODULE__)
"""
DateRange
Represents a date interval, between `start` and `stop`, with a 1 day step.
Represents a date interval, between `from` and `to`, with a 1 day step.
"""
Base.@kwdef mutable struct DateRange
start::Date = today()
stop::Date = today()
from::Date = today()
to::Date = today()
end

DateRange(dr::StepRange{Date,Day}) = DateRange(dr.start, dr.stop)
DateRange(dr::StepRange{Date,Day}) = DateRange(dr.from, dr.to)

"""
datepicker()
Expand Down Expand Up @@ -133,11 +133,11 @@ function Base.parse(::Type{Date}, d::String) :: Date
end

function Stipple.render(dr::DateRange, _::Union{Symbol,Nothing} = nothing)
Dict(:from => dr.start, :to => dr.stop)
Dict(:from => dr.from, :to => dr.to)
end

function Stipple.render(vdr::Vector{DateRange}, _::Union{Symbol,Nothing} = nothing)
[ Dict(:from => dr.start, :to => dr.stop) for dr in vdr ]
[ Dict(:from => dr.from, :to => dr.to) for dr in vdr ]
end

function Base.parse(::Type{DateRange}, d::Dict{String,Any})
Expand Down

0 comments on commit 666b159

Please sign in to comment.