From 8d7c4cd108f9e45629e9547662cb9cc16520ad96 Mon Sep 17 00:00:00 2001 From: Thomas Breloff Date: Thu, 18 Aug 2016 17:32:31 -0400 Subject: [PATCH] type recipe for Dates; closes #451 --- src/recipes.jl | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/recipes.jl b/src/recipes.jl index 2fb8193e..8c90e7cd 100644 --- a/src/recipes.jl +++ b/src/recipes.jl @@ -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 +