fix Date recipe; closes #529

This commit is contained in:
Thomas Breloff 2016-10-10 07:02:10 -04:00
parent ae608d4d78
commit b9dea42be6
2 changed files with 4 additions and 10 deletions

View File

@ -790,12 +790,6 @@ abline!(args...; kw...) = abline!(current(), args...; kw...)
# -------------------------------------------------
# Dates
@recipe function f{T<:AbstractArray{Date}}(::Type{T}, dts::T)
date_formatter = dt -> string(convert(Date, dt))
Formatted(map(dt->convert(Int,dt), dts), date_formatter)
end
@recipe function f{T<:AbstractArray{DateTime}}(::Type{T}, dts::T)
date_formatter = dt -> string(convert(DateTime, dt))
Formatted(map(dt->convert(Int,dt), dts), date_formatter)
@recipe function f{T<:Union{Date,DateTime}}(::Type{T}, dt::T)
dt -> convert(Int,dt), dt -> string(convert(Date, dt))
end

View File

@ -42,8 +42,8 @@ convertToAnyVector(v::Volume, d::KW) = Any[v], nothing
# # vector of OHLC
# convertToAnyVector(v::AVec{OHLC}, d::KW) = Any[v], nothing
# dates
convertToAnyVector{D<:Union{Date,DateTime}}(dts::AVec{D}, d::KW) = Any[dts], nothing
# # dates
# convertToAnyVector{D<:Union{Date,DateTime}}(dts::AVec{D}, d::KW) = Any[dts], nothing
# list of things (maybe other vectors, functions, or something else)
function convertToAnyVector(v::AVec, d::KW)