How to conditionally identify the day and calculate future dates based on it?