The easiest and fastest way to process data on the client side (sorting, filtering, grouping) is jOrder.
In your case, I assume the data looks something like this: (date1 and date2 are date objects)
var data = [{flight: '776', departure: date1}, {flight: '51', departure: date2}];
First, create a jOrder table from an array with a departure time index.
var table = jOrder(data) .index('departure', ['departure'], {grouped: true, ordered: true});
Then you can easily select a row with dates in the specified range.
var hits = table.where([{ departure: {lower: datelow, upper: datehi}}], {mode: jOrder.range});
Finally, you can rebuild or modify the user interface objects to fit the images.
jOrder is available at http://github.com/danstocker/jorder .
Dan Stocker Jul 24 '10 at 16:18 2010-07-24 16:18
source share