@@ -411,12 +411,12 @@ function timedecode(::Type{DateTime}, data, units)
411411 return to_datetime .(timedecode (DateTimeProlepticGregorian, data, units))
412412end
413413
414- _timeencode (:: Type{DT2} , dt:: Missing ) where {DT2 <: AbstractCFDateTime{Tperiod} } where {Tperiod} = missing
414+ timeencode (:: Type{DT2} , dt:: Missing ) where {DT2 <: AbstractCFDateTime{Tperiod} } where {Tperiod} = missing
415415# fast pass, prevent type promotion in division
416- function _timeencode (:: Type{DT2} , dt:: DT2 ) where {DT2 <: AbstractCFDateTime{Tperiod} } where {Tperiod}
416+ function timeencode (:: Type{DT2} , dt:: DT2 ) where {DT2 <: AbstractCFDateTime{Tperiod} } where {Tperiod}
417417 return Dates. value (dt)
418418end
419- function _timeencode (:: Type{DT2} , dt) where {DT2 <: AbstractCFDateTime{Tperiod} } where {Tperiod}
419+ function timeencode (:: Type{DT2} , dt) where {DT2 <: AbstractCFDateTime{Tperiod} } where {Tperiod}
420420 t0 = origin (DT2)
421421 Δt = oneunit (Tperiod)
422422 return (dt - t0) / Δt
@@ -490,15 +490,15 @@ function timeencode(
490490 ) where {DT <: Union{AbstractCFDateTime, Missing} }
491491 T = Int64 # use type promotion?
492492 DTT = timetype (Tcalendar, units, T)
493- return _timeencode .(DTT, data)
493+ return timeencode .(DTT, data)
494494end
495495
496496# homogenous array should preserve the type of the underlying duration
497497function timeencode (
498498 data:: Union{DT, AbstractArray{DT}} , units, Tcalendar:: Type{<:AbstractCFDateTime} ,
499499 ) where {DT <: AbstractCFDateTime{TPeriod} } where {TPeriod <: Period{T} } where {T}
500500 DTT = timetype (Tcalendar, units, T)
501- return _timeencode .(DTT, data)
501+ return timeencode .(DTT, data)
502502end
503503
504504# do not transform data is not a vector of DateTime
0 commit comments