Почему при смене >= на == данный код не работает?
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.24.0/moment.min.js" integrity="sha256-4iQZ6BVL4qNKlQ27TExEhBN1HFPvAvAMbFavKKosSWQ=" crossorigin="anonymous"></script>
<script>
$(function() {
$("#from").bind('keyup change', function() {
var val1 = moment($('#from').val().toLowerCase(), 'YYYY');
$("#my-table").find('tr').filter(function() {
$(this).toggle(
(moment($(this).find('td').text().toLowerCase(),'YYYY') >= (val1) || !val1["_isValid"])
)
});
})
});
</script>
<div class="container">
Date:
<select id="from">
<option value="2020" selected>2020</option>
<option value="2019">2019</option>
<option value="2018">2018</option>
<option value="2017">2017</option>
<option value="2016">2016</option>
</select>
<br>
<table>
<thead>
<tr>
<th>Date</th>
<th>Name</th>
</tr>
</thead>
<tbody id="my-table">
<tr class="list-group">
<td>2020</td>
<td>John</td>
</tr>
<tr class="list-group">
<td>2019</td>
<td>notif</td>
</tr>
<tr class="list-group">
<td>2018</td>
<td>food</td>
</tr>
<tr class="list-group">
<td>2017</td>
<td>yop</td>
</tr>
<tr class="list-group">
<td>2018</td>
<td>wick</td>
</tr>
</tbody>
</table>
</div>