Показать сообщение отдельно
  #5 (permalink)  
Старый 13.03.2011, 12:02
Новичок на форуме
Посмотреть профиль Найти все сообщения от vazerdim
 
Регистрация: 12.03.2011
Сообщений: 6

Вроде разобрался как сделать, вот код:

<script type="text/javascript">
    $(document).ready(
  function () {
      var systemDateArr = $("#SystemDate").text().split(".");
      var convertedSystemDate = Date.parse(systemDateArr[1] + '/' + systemDateArr[0] + '/' + systemDateArr[2]);
      $(".listtable tr").filter(function () {

          var status = $(this).children('td:nth-child(6)').text();

          if (status) {
              var endDate = $(this).children('td:nth-child(4)').text();
              var endDateArr = endDate.split(".");
              var convertedEndDate = Date.parse(endDateArr[1] + '/' + endDateArr[0] + '/' + endDateArr[2]);

              if (status.match('100%')) {
                  $(this).children('td:nth-child(4)').css('background', '#33FF33');
                  return true;
              }
              else {
                  if (convertedEndDate < convertedSystemDate) {
                      $(this).children('td:nth-child(4)').css('background', '#F3665F');
                      return true;
                  }
                  if (convertedEndDate >= convertedSystemDate && convertedEndDate <= (convertedSystemDate + (7 * 24 * 3600 * 1000))) {
                      $(this).children('td:nth-child(4)').css('background', '#FFFF00');
                      return true;
                  }
              }
          }
      });
  }
);
</script>


Спасибо lalala
Ответить с цитированием