logic to get the first and the last selected dates in order to get the range of indexpath

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