better performance at the time of selecting long ranges of dates

Signed-off-by: Ruben Mendez <ruben.mendez@gmail.com>