I would like to know if you can modify the ds-datepicker
directive of AngularJS to show only the months and years
I would like to know if you can modify the ds-datepicker
directive of AngularJS to show only the months and years
Based on this answer , I think you're looking for this:
element.datepicker({
format: "mm-yyyy", //Seteas el formato
minViewMode: "months", // Que campos mostraras al desplegar el datepick
startDate: "01-1000",
endDate: "12-9999",
orientation: "top left",
autoclose: true,
onSelect: function (date) {
ngModelCtrl.$setViewValue(date);
scope.$apply();
}
});
With format: "mm-yyyy"
you give the desired format that you are going to show in this case Month / Year and with minViewMode: "months"
the field that will be displayed when deploying.