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">
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">
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.
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