From 0192dbb7fe74d081cc3503a499a7032d7fd8177a Mon Sep 17 00:00:00 2001 From: MichelJuillard <michel.juillard@mjui.fr> Date: Sat, 11 Dec 2021 18:46:08 +0100 Subject: [PATCH] fix display --- src/TimeDataFrames.jl | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/TimeDataFrames.jl b/src/TimeDataFrames.jl index 68160b1..07301a5 100644 --- a/src/TimeDataFrames.jl +++ b/src/TimeDataFrames.jl @@ -4,6 +4,8 @@ using CSV using DataFrames using ExtendedDates +import Base: show + export TimeDataFrame, innerjoin, outerjoin mutable struct TimeDataFrame @@ -338,4 +340,14 @@ function outerjoin(d1::TimeDataFrame, d2::TimeDataFrame) return TimeDataFrame(sort!(DataFrames.outerjoin(data1, data2, on=:Column1),1), union(periods1, periods2), true) end +function Base.show(io::IO, tdf::TimeDataFrame) + df = getfield(tdf, :data) + dfcopy = copy(df) + periods = getfield(tdf, :periods) + insertcols!(dfcopy, 1, :Periods => periods) + show(io, dfcopy, show_row_number = false, eltypes = false) +end + +Base.show(tdf::TimeDataFrame) = show(stdout, tdf) + end # module -- GitLab