From b9dea42be662b2716e8854b225a5804e02be147a Mon Sep 17 00:00:00 2001 From: Thomas Breloff Date: Mon, 10 Oct 2016 07:02:10 -0400 Subject: [PATCH] fix Date recipe; closes #529 --- src/recipes.jl | 10 ++-------- src/series.jl | 4 ++-- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/recipes.jl b/src/recipes.jl index 809c3477..e9c29cee 100644 --- a/src/recipes.jl +++ b/src/recipes.jl @@ -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 diff --git a/src/series.jl b/src/series.jl index 86be6954..8b836af4 100644 --- a/src/series.jl +++ b/src/series.jl @@ -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)