9

I want to set the ngbDatepicker to begin the week on Sunday instead of the default day Monday.

I am trying to use weekStartsOn="0" but it has no effect. This is my html code

<input ngbDatepicker #d="ngbDatepicker" class="form-control" [minDate]="minDate" [maxDate]="maxDate" [markDisabled]="isDisabled" weekStartsOn="0">

Jake Neumann
  • 372
  • 4
  • 13

1 Answers1

11

You can achieve that by passing in 7 to the firstDayOfWeek input property.

E.g.

<input class="form-control" placeholder="yyyy-mm-dd" name="dp" 
    [(ngModel)]="model" ngbDatepicker #d="ngbDatepicker" firstDayOfWeek="7">

enter image description here

If you need to further configure/tweak your datepicker, you can take a look at ng-bootstrap datepicker component's full API here: Ng-Bootstrap Datepicker API.

Here's a forked stackblitz to show that it works: Stackblitz Example.

terahertz
  • 2,915
  • 1
  • 21
  • 33