Adding the code to generate the video based on selection dates