Datepicker Angularjs startWeek on Monday

I have a problem with angular md-datepicker. It starts by default on Sunday, but I need to start on Monday.

I tried to add a parameter to the controller, but it does not work. Can anybody help me?

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> 
+5
source share
1 answer

Use the following code to configure the first day of the 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 a link for a working example.

Link for example

You need to change the start day of the week using $ mdDateLocaleProvider.

+7
source

All Articles