harbingerOTV
10-25-2010, 07:48 PM
My turn to ask ;)
I have a table basically like this:
<tr>
<td>09.11.2010</td><td>11:30 AM</td><td>Location</td><td>Team</td><td>Outcome</td>
</tr>
<tr>
<td>10.29.2010</td><td>11:30 AM</td><td>Location</td><td>Team</td><td>Outcome</td>
</tr>
<tr>
<td>11.7.2010</td><td>11:30 AM</td><td>Location</td><td>Team</td><td>Outcome</td>
</tr>
What I am trying to do is grab the first cell (the date) and that's easy enough. What I am struggling with is comparing that date to today's date. If it's in the past ignore it. If it's in the future and the first one in the future, do my function.
So in the sample table above, it would ignore the first line, stop at the second as it's the next date from today and run my function.
I just need a hand converting today into a string that I can compare to the data in the table correctly.
Essentially I think the start is somethign liek:
function nextGame() {
$('#foo').load('schedule.html .scheduletable', function() {
$('#foo tbody tr').each(function(){
var startdate= $(this).children('td:eq(0)').text();
// beats me
});
});
}
I have a table basically like this:
<tr>
<td>09.11.2010</td><td>11:30 AM</td><td>Location</td><td>Team</td><td>Outcome</td>
</tr>
<tr>
<td>10.29.2010</td><td>11:30 AM</td><td>Location</td><td>Team</td><td>Outcome</td>
</tr>
<tr>
<td>11.7.2010</td><td>11:30 AM</td><td>Location</td><td>Team</td><td>Outcome</td>
</tr>
What I am trying to do is grab the first cell (the date) and that's easy enough. What I am struggling with is comparing that date to today's date. If it's in the past ignore it. If it's in the future and the first one in the future, do my function.
So in the sample table above, it would ignore the first line, stop at the second as it's the next date from today and run my function.
I just need a hand converting today into a string that I can compare to the data in the table correctly.
Essentially I think the start is somethign liek:
function nextGame() {
$('#foo').load('schedule.html .scheduletable', function() {
$('#foo tbody tr').each(function(){
var startdate= $(this).children('td:eq(0)').text();
// beats me
});
});
}