Here is the template of my application: http://live.datatables.net/xipileni/13/edit
When you first load the page, the default behavior is to load the data from the last month (with respect to the calendar).
The problem is that the data might be from previous years, and it implies no data is shown at the default load.
For that, I want to change this default behavior, to show in default the data from the last 30 days, but with respect to the data itself. That is, 30 days, with respect to the maximum date that exists in the data.
My difficulty is with doing that - I know that for that I have to change these 2 lines:
dateMin = startdate; dateMax = enddate;
To something like that:
dateMax = fetchMaxDateFromData(); dateMin = dateMax - 30;
But I didn't figure out how can I implement this
fetchMaxDateFromData(), because currently what happens is that
aData is iterating over all the records' dates one by one.
Can someone please help me with doing that?