我用的是 angularjs-daterangepicker 在我的Angularjs应用程序中。从下图可以看出,日期显示错误。
<button type="button"
ng-click="$ctrl.DateRangeChanged()"
date-range-picker="$ctrl.durationDateRange"
ng-model="$ctrl.date"
options="$ctrl.options" >Customize
</button>
日期范围的选项如下
this.options = {
pickerClasses: 'custom-display', // angular-daterangepicker extra
buttonClasses: 'btn',
applyButtonClasses: 'btn-primary',
cancelButtonClasses: 'btn-danger',
locale: {
applyLabel: 'Apply',
cancelLabel: 'Cancel',
customRangeLabel: 'Custom range',
separator: ' - ',
format: 'YYYY-MM-DD', // will give you 2017-01-06
// format: "D-MMM-YY", // will give you 6-Jan-17
// format: "D-MMMM-YY", //will give you 6-January-17
},
timePicker: true,
autoApply: true,
showDropdowns: true,
startDate: (moment()).startOf('day'),
};
你必须在你的输入中添加日期范围选择器选项。
<button type="button"
ng-click="$ctrl.DateRangeChanged()"
date-range-picker="$ctrl.durationDateRange"
ng-model="$ctrl.date"
date-range-picker-options="$ctrl.options" >Customize
</button>