Skip to content

Commit

Permalink
fix(material/core): native adapter uses locale data
Browse files Browse the repository at this point in the history
  • Loading branch information
fetis committed Jan 28, 2021
1 parent 2f61895 commit 220bbc7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/material/core/datetime/native-date-adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import {Platform} from '@angular/cdk/platform';
import {Inject, Injectable, Optional} from '@angular/core';
import {getLocaleFirstDayOfWeek} from '@angular/common';
import {DateAdapter, MAT_DATE_LOCALE} from './date-adapter';

// TODO(mmalerba): Remove when we no longer support safari 9.
Expand Down Expand Up @@ -146,8 +147,7 @@ export class NativeDateAdapter extends DateAdapter<Date> {
}

getFirstDayOfWeek(): number {
// We can't tell using native JS Date what the first day of the week is, we default to Sunday.
return 0;
return getLocaleFirstDayOfWeek(this.locale);
}

getNumDaysInMonth(date: Date): number {
Expand Down

0 comments on commit 220bbc7

Please sign in to comment.