server/ui: Recompute maybeIndexFromTime on demand
server/ui: Recompute maybeIndexFromTime on demand

This simplifies the code, and I doubt there's any real performance hit.

emk/substudy,emk/substudy,emk/substudy,emk/substudy,emk/substudy