How to iterate through table(Javascript)

Help wanted.
Consider a table having these values.

01.07.2010 9hrs
02.07.2010 9hrs
04.07.2010 9hrs

Now i need the dates that do not have hours. i.e on 03.07.2010 there are no hours in this table.But I need that date value. Basically i need to know which all dates do not have hours from this table. I need to know the dates that are not present in this table and the date can from 01.02.2010 and 30.02.2010. Can anyone please help me on this logic. I am not able to get a javascript logic to get the dates that do not have an entry in this table.

for(var d in allDates)

that implies that it is an associative array any you want all the properties and methods and not just the actual array entries. You should use a normal for or while loop to process an array where you don’t want to process methods as well as properties.

Hi, I will try to help you

First of all you need strategy.

  1. Find all values in table
  2. generate all dates and put them into array
  3. go trough all values from table and check does value contain hrs and mark them properly.

Example:
to check if value contain valid date you can use next regex
([0-9]{0,2})\.([0-9]{0,2})\.([0-9]{0,4})(\s){0,1}([0-9]hrs)

now you can loop trough list of all dates and check if value exists in your array generated during looping trough rows of table

Example:


var allDates;
var generatedDates;

for(var d in allDates)
{
  if(generatedDates[d])
    //code if date exists
   else
    //code if date doesn't exists
}