added support for several time periods on sinatra... not sure if it's all tested