Monotonically time series with resets

I have a time series that increase monotonically that spans an entire day.

During the day this time series is reset.

I would need to get the max value before each reset and the last max value before the end of the day.

I could figure out a function for such task but I’m wondering whether there is something easier or quicker using Flux.