I've a problem with angular md-datepicker. It's start by default on Sunday, but I need to start on Monday.
I've been tried to add an option to the controller, but it doesn't work. Anyone can help me please?
This is the code:
$scope.dateOptions = {
formatYear: 'yy',
showWeeks: false,
firstDayOfWeek : 1
};
<md-datepicker ng-model="desdeDate" md-placeholder="Enter date" options="dateOptions"></md-datepicker>
Use following code to configure first day of week in md-date
angular.module('MyApp').controller('AppCtrl', function($scope) {
$scope.myDate = new Date();
}).config(function($mdDateLocaleProvider) {
// Can change week display to start on Monday.
$mdDateLocaleProvider.firstDayOfWeek = 1;
// Optional.
});
Below is link for working example.
Link for example
You need to change start day of week using $mdDateLocaleProvider.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With