我正在尝试提取日期。我有JavaScript代码,我不知道我做错了什么。下面的代码中有一个开始日期和结束日期。
我需要从基于JavaScript的表单中选择日期。这两个功能和细节如下。请查看代码,并告诉我问题在哪里。
function valuation_date_from(maxDate) {
var d = new Date();
var startDate = d.getDate() + "/" + (d.getMonth() + 1) + "/" + d.getFullYear();
var datepicker1 = {
singleDatePicker: true,
calender_style: "picker_3",
timePicker: true,
startDate: startDate,
timePicker24Hour: true,
minDate: startDate,
timePickerIncrement: 5,
format: 'DD/MM/YYYY h:mm a',
onSelect:function(){
alert();
}
};
if (maxDate != '') {
datepicker1.maxDate =PrevDay(maxDate);
}
$('#valuation_date_from').daterangepicker(datepicker1, function(start, end, label) {
// console.log(start.format('DD/MM/YYYY h:mm a'));
valuation_date_to(start.format('DD/MM/YYYY h:mm a'),$('#pricing_date_from').val());
if($('#valuation_date_to').val()==""){
pricing_date_from('',start.format('DD/MM/YYYY h:mm a'));
}
if($('#pricing_date_from').val()==""){
pricing_date_to(start.format('DD/MM/YYYY h:mm a'));
}
});
}
和日期:
function valuation_date_to(minDate,maxDate) {
var d = new Date();
var startDate = d.getDate() + "/" + (d.getMonth() + 1) + "/" + d.getFullYear();
var datepicker2 = {
singleDatePicker: true,
minDate: startDate,
startDate: nextDay(minDate),
calender_style: "picker_3",
timePicker: true,
timePicker24Hour: true,
timePickerIncrement: 5,
format: 'DD/MM/YYYY h:mm a'
};
if (minDate != '') {
datepicker2.minDate = nextDay(minDate);
}
if (maxDate != '') {
datepicker2.maxDate = PrevDay(maxDate);
}
$('#valuation_date_to').daterangepicker(datepicker2, function(start, end, label) {
valuation_date_from(start.format('DD/MM/YYYY h:mm a'));
pricing_date_from($('#pricing_date_to').val(),start.format('DD/MM/YYYY h:mm a'));
if($('#pricing_date_from').val()==""){
pricing_date_to(start.format('DD/MM/YYYY h:mm a'));
}
});
}
感谢任何帮助。感谢。