<input type="text" name="daterange" class="form-control input-box-style " PLACEHOLDER="calendar" id="dateone" />
<script type="text/javascript">
$(document).ready(function() {
updateConfig();
function updateConfig() {
var options = {};
options.opens = "center";
options.ranges = {
format: 'YYYY-MM-DD',
'Today': [moment(), moment()],
'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
'Last 7 Days': [moment().subtract(6, 'days'), moment()],
'Last 30 Days': [moment().subtract(29, 'days'), moment()],
'This Month': [moment().startOf('month'), moment().endOf('month')],
'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
};
$('#dateone').daterangepicker(options, function(start, end, label) {
var startDate = start.format('YYYY-MM-DD'); var endDate = end.format('YYYY-MM-DD');
passDate(startDate,endDate);
});
}
});
function passDate(startDate,endDate) {
//alert(endDate);
$.ajax({
type: "POST",
url: "user_event_datepick.php",
//data: 'startDate='+startDate,
data: {
startDate: startDate,
endDate:endDate
},
success: function(response){
// alert(response);
$('#cat').html(response);
}
});
}
</script>
当我将日期传递到搜索页面时,日期值显示为mm / dd / yyyy ....您能帮我扭转顺序并将其转移到/ -