I have a dropdown menu with various time options like this:
<select name="" id="delyvery-hour">
<option value="18:00">18:00</option>
<option value="18:05">18:05</option>
<option value="18:15">18:15</option>
<option value="18:20">18:20</option>
<option value="18:25">18:25</option>
...
<option value="20:00">20:00</option>
</select>
Using jQuery, I want to display only the options that are 50 minutes ahead of the current time.
For example, if it's currently 18:00, I only want to show options starting from 18:50. Or if it's 19:20, I want to display options from 20:10 onwards.
You can see an example here: https://codepen.io/7lifedesign/pen/dyvaxWW
var dt = new Date();
var time = dt.getHours();
document.write(time);
$('#delyvery-hour option').filter(function(){
return parseInt(this.value,10) < time;
}).remove();