<style>
.hide {
display: none;
}
</style>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<ul>
<li class="seminargr" id="eq-0">
<a href="seminar-test"><b id="date2">09-07-2015</b><br>Санкт-Петербург</a>
<div id="date1" style="display:none">23-07-2015</div>
<div class="myDiv1">9072015</div>
<div class="myDiv2">23072015</div>
</li><li class="seminargr" id="eq-1">
<a href="seminar-test"><b id="date2">18-07-2015</b><br>Санкт-Петербург</a>
<div id="date1" style="display:none">23-07-2015</div>
<div class="myDiv1">9072015</div>
<div class="myDiv2">23072015</div>
</li><li class="seminargr" id="eq-2">
<a href="seminar-test"><b id="date2">23-07-2015</b><br>Санкт-Петербург</a>
<div id="date1" style="display:none">23-07-2015</div>
<div class="myDiv1">9072015</div>
<div class="myDiv2">23072015</div>
</li><li class="seminargr" id="eq-3">
<a href="seminar-test"><b id="date2">31-07-2015</b><br>Санкт-Петербург</a>
<div id="date1" style="display:none">23-07-2015</div>
<div class="myDiv1">9072015</div>
<div class="myDiv2">23072015</div>
</li><li class="seminargr" id="eq-4">
<a href="seminar-test"><b id="date2">06-07-2015</b><br>Санкт-Петербург</a>
<div id="date1" style="display:none">23-07-2015</div>
<div class="myDiv1">9072015</div>
<div class="myDiv2">23072015</div>
</li><li class="seminargr" id="eq-5">
<a href="seminar-test"><b id="date2">17-08-2015</b><br>Санкт-Петербург</a>
<div id="date1" style="display:none">23-07-2015</div>
<div class="myDiv1">9072015</div>
<div class="myDiv2">23072015</div>
</li><li class="seminargr" id="eq-6">
<a href="seminar-test"><b id="date2">03-08-2015</b><br>Санкт-Петербург</a>
<div id="date1" style="display:none">23-07-2015</div>
<div class="myDiv1">9072015</div>
<div class="myDiv2">23072015</div>
</li><li class="seminargr" id="eq-7">
<a href="seminar-test"><b id="date2">20-07-2015</b><br>tyutyutyu</a>
<div id="date1" style="display:none">23-07-2015</div>
<div class="myDiv1">9072015</div>
<div class="myDiv2">23072015</div>
</li>
</ul>
<script>
var indexedElement = $('.seminargr');
indexedElement.attr('id', function(index) {
return 'eq-' + index;
}).each(function() {
var date1 = $(this.querySelectorAll('#date1')).text();
var date2 = $(this.querySelectorAll('#date2')).text();
var newValue = date2.replace(/[^0-9\.]/g, '');
var newValue2 = date1.replace(/[^0-9\.]/g, '');
var myInteger = parseInt(newValue);
var myInteger2 = parseInt(newValue2);
if(myInteger2 > myInteger) {
$(this).addClass( "hide" );
}
$(this).find(".myDiv1" ).text(myInteger);
$(this).find(".myDiv2" ).text(myInteger2);
});
</script>