Count days in timeseries range

Does this post help (it’s almost 4 years old, but it may still be relevant).