range time with minTime and maxTime parameters

and complete documentation with a testcase.
make use a while-loop instead of two for-loop,
seems compatible with futureOnly parameter