Suppose I have an EventSeries
and I need to extract the values corresponding to some DateObject
, taking properly into account the TimeZone
and possible repetions of dates. I way I considered and probably used in the pas was to "evaluate" the EventSeries
at the list of dates. Now I'm unable to reproduce this process.
For example consider the code:
date = DateObject[]
es = EventSeries[{1}, {{date}}]
es["DatePath"]
es["FirstDate"] === date
(*True*)
es[date]
(*Missing[]*)
I also tried
Replace[date, Rule @@@ es["DatePath"]]
(*no replacement done*)
with no success.
What is the supported way to do the job described?
Please note I have/want/need an EventSeries
, not a potentially interpolating TimeSeries
.
POSSIBLE WORKAROUND 1
First /@ Nearest[es["Times"] -> es["Values"], AbsoluteTime /@ {date, date, date}, {1, 0.01}]