type recipe for Dates; closes #451

This commit is contained in:
Thomas Breloff 2016-08-18 17:32:31 -04:00
parent 99f608defb
commit 8d7c4cd108

View File

@ -958,3 +958,14 @@ function abline!(plt::Plot, a, b; kw...)
end
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))
xformatter := date_formatter
map(dt->convert(Int,dt), dts)
end