I try search by date from directory tree.
But date is in file creation date is in filename and I want search between startDate and endDate.
My HTML:
<div class="row">
<div style="float:left; width:17%;">
<input type="text" style="height:37px;" id="startDate" class="form-control" placeholder="DD/MM/YY">
</div>
<div style="float:left; width:17%; margin:0 1%;">
<div class="input-group">
<input type="text" style="width:97.71px;" id="endDate" height:37px;" class="form-control" placeholder="DD/MM/YY" />
<span class="input-group-btn">
<button style="padding: 7.5px 12px; left:-1px;" class="btn btn-default" id="DateSearch" type="button"><i class="fa fa-search"></i></button>
</span>
</div>
</div>
Split as i mentioned in my Comments to make year-month-date
in this format and compare each file date with your from - to
range
example
Html
<p class="date">2013-08-4</p>
<p class="date">2014-09-5</p>
<p class="date">2015-09-5</p>
<p class="date">2016-09-5</p>
Code
$(function() {
var from = new Date("2013-09-4").getTime();
var to = new Date("2014-09-8").getTime();
$(".date").each(function(index, value) {
var dates = $(this).text();
if (from <= new Date(dates).getTime() && to >= new Date(dates).getTime()) {
$(this).css("color", "blue");
}
});
});
Output
You could do the same in PHP using strtotime($the_date);
which gives you minutes