Fix timeframe calculations when assume_quality plugin is used. fix #2797