https://github.com/angular-ui/ui-date在項目中,我使用了適合angular的datepicker,現在有一個問題解決不了。開始時間:結束時間:搜索Angular:.....controller('someCtrl',function(...)){$scope.startDateOptions={changeYear:true,changeMonth:true,onClose:function(selectedDate){varend=$('#end');vard=$('#start').datepicker("getDate");end.datepicker("setDate",newDate(d.getFullYear(),d.getMonth(),d.getDate()+1));end.datepicker("option","minDate",selectedDate);$scope.enddate=parseInt($scope.startdate)+24*60*60*1000;}};$scope.endDateOptions={changeYear:true,changeMonth:true,onClose:function(selectedDate){varstart=$("#start");if(start.val()==''){vard=$('#end').datepicker("getDate");start.datepicker("setDate",newDate(d.getFullYear(),d.getMonth(),d.getDate()-1));$scope.startdate=parseInt($scope.enddate)-24*60*60*1000;}start.datepicker("option","maxDate",selectedDate);}};}現在就是點擊第一個,然后第二個input會自動填上到第二天的時間,點擊搜索完,第二個Input不會顯示日期。因為第二個是setDate上去的。如果是點擊第一個input,再選擇第二個input。它們都可以顯示日期?,F在不知道怎么解決。
AngularJS版jquery datepicker有一小點問題
拉莫斯之舞
2019-04-08 11:19:19