hello,
I have populated an array with databack from a webservice and need to populate the UI based on the last 6 years, even if they do not exist in the data. The Data coming back can be in terms of the UI incomplete, so what I need to do is insert values into the array for the "missing pieces".
Example
Data returns {2010, 2007}
What my javascript code must do is loop through the data returned, check the values of the indices, and insert values where needed.
UI returns (2010, 2009, 2008, 2007, 2006, 2005}
Also in 3 years when the dates have changed (current year is 2013)
Data returns {2011, 2009, 2008} UI returns {2013, 2012, 2011, 2010, 2009, 2008}
The array is populated with a return from a webservice, the webservice only puts values into the array that exist in the database, but the UI needs to display all values from the range 2010-2006 (ie data from the last 6 years, so in the future it could be 2015-2011)