mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
test(datepicker): set locale to en-US (#5049)
Currently, some of the datepicker tests will fail if the browser's locale is different from en-US. These changes set the locale to en-US in order to avoid potential issues in the future.
This commit is contained in:
committed by
Andrew Seguin
parent
6b659eeda2
commit
419d9da59b
@@ -8,7 +8,7 @@ import {By} from '@angular/platform-browser';
|
||||
import {dispatchFakeEvent, dispatchMouseEvent} from '../core/testing/dispatch-events';
|
||||
import {MdInputModule} from '../input/index';
|
||||
import {NoopAnimationsModule} from '@angular/platform-browser/animations';
|
||||
import {MdNativeDateModule} from '../core/datetime/index';
|
||||
import {MdNativeDateModule, DateAdapter, NativeDateAdapter} from '../core/datetime/index';
|
||||
|
||||
|
||||
// When constructing a Date, the month is zero-based. This can be confusing, since people are
|
||||
@@ -29,6 +29,13 @@ describe('MdDatepicker', () => {
|
||||
NoopAnimationsModule,
|
||||
ReactiveFormsModule,
|
||||
],
|
||||
providers: [
|
||||
{provide: DateAdapter, useFactory: () => {
|
||||
let adapter = new NativeDateAdapter();
|
||||
adapter.setLocale('en-US');
|
||||
return adapter;
|
||||
}}
|
||||
],
|
||||
declarations: [
|
||||
DatepickerWithFilterAndValidation,
|
||||
DatepickerWithFormControl,
|
||||
|
||||
@@ -3,7 +3,7 @@ import {Component} from '@angular/core';
|
||||
import {By} from '@angular/platform-browser';
|
||||
import {MdMonthView} from './month-view';
|
||||
import {MdCalendarBody} from './calendar-body';
|
||||
import {MdNativeDateModule} from '../core/datetime/index';
|
||||
import {MdNativeDateModule, DateAdapter, NativeDateAdapter} from '../core/datetime/index';
|
||||
|
||||
|
||||
// When constructing a Date, the month is zero-based. This can be confusing, since people are
|
||||
@@ -18,6 +18,13 @@ describe('MdMonthView', () => {
|
||||
imports: [
|
||||
MdNativeDateModule,
|
||||
],
|
||||
providers: [
|
||||
{provide: DateAdapter, useFactory: () => {
|
||||
let adapter = new NativeDateAdapter();
|
||||
adapter.setLocale('en-US');
|
||||
return adapter;
|
||||
}}
|
||||
],
|
||||
declarations: [
|
||||
MdCalendarBody,
|
||||
MdMonthView,
|
||||
|
||||
@@ -3,7 +3,7 @@ import {Component} from '@angular/core';
|
||||
import {By} from '@angular/platform-browser';
|
||||
import {MdYearView} from './year-view';
|
||||
import {MdCalendarBody} from './calendar-body';
|
||||
import {MdNativeDateModule} from '../core/datetime/index';
|
||||
import {MdNativeDateModule, DateAdapter, NativeDateAdapter} from '../core/datetime/index';
|
||||
|
||||
|
||||
// When constructing a Date, the month is zero-based. This can be confusing, since people are
|
||||
@@ -18,6 +18,13 @@ describe('MdYearView', () => {
|
||||
imports: [
|
||||
MdNativeDateModule,
|
||||
],
|
||||
providers: [
|
||||
{provide: DateAdapter, useFactory: () => {
|
||||
let adapter = new NativeDateAdapter();
|
||||
adapter.setLocale('en-US');
|
||||
return adapter;
|
||||
}}
|
||||
],
|
||||
declarations: [
|
||||
MdCalendarBody,
|
||||
MdYearView,
|
||||
|
||||
Reference in New Issue
Block a user