Help with AngularJS bs-datepicker

-2

I would like to know if you can modify the ds-datepicker directive of AngularJS to show only the months and years

    
asked by Héctor Veitía 17.12.2015 в 17:40
source

1 answer

2

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.

    
answered by 17.12.2015 в 17:52