I have drop down boxes on my site that allows developers to enter a start date and an end date and a user-defined value corresponding to those dates.
For example from the dates 12 February 2002 to 22 June 2002 the price is high.
The drop down boxes return the dates in the format yyyymmdd.
For example '20020212' corresponds to '12 february 2002' and so on.
I want to loop through the numbers in the formatyyyymmdd (start date value) to yyyymmdd(end date value) and give each day a user-defined value.
For example from 2002 06 22 to 2002 08 16 the price is low.
However I want a check so that when the date reaches the limit for its month (e.g. 2002 01 32 exceeds the limit for january) it will ignore these values and begin inserting the relevant data in the range for the next month (in this case 20020201).
I have started writing code to do this, but it's very long. I was wondering if anybody can suggest a short way of doing it? Are there any date/caldender scripts out there that can convert number ranges to relevant dates?