Hi Adam,
I have been playing with the code and I think the date format at line 24 is in the US format i.e. mm-dd-yyyy as I was getting a few more records than I expected. I have changed it to the following
var date_string = "09-01-" + year;
sept = moment(date_string).valueOf();
This seems to work fine.
Thanks for your efforts.
Alan