title: edit code to stop downloading on a certain month AND year
body: <p>I am currently using the following code to download some data. The code works well except when I want to stop the downloading on a certain month of a year. </p>
  
  <p>E.g. If I want to stop downloading on month=02 and year=2019, it doesnt't work. I set max month to 02 and max year to 2019, however then it only downloads the second month of every year instead of up to the second month of 2019 (with every other month of the years before)</p>
  
  <p>How can I edit my code to fix this problem?</p>