I’m trying to modify an API call so that it only pulls data down in 15-day increments (because otherwise the dataset is too large and I get an error).
I’ve created a component that asks for the start and end date, and then I can calculate the number of 15 day periods that I need, but I’m struggling to figure out how to make a loop that will take the start and end dates for each of the 15 day periods. My first thought is that I should create a nice data table with start and end dates for each period.
For example, if a user puts in a start date of April 1 and an end date of May 31, It should be split into 5 chunks.
Then, after splitting it into these 5 chunks, I’d like to use a loop so that it can replace the start and end date in the API call using a string manipulator and make 5 separate calls for each of the 5 date chunks.
Any ideas on how to do this?