Skip to content

Commit add8fc9

Browse files
committed
test(calendar): respect viewDate is always 1 #7039
1 parent d514513 commit add8fc9

File tree

3 files changed

+24
-4
lines changed

3 files changed

+24
-4
lines changed

projects/igniteui-angular/src/lib/calendar/README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ The calendar header will not be rendered when the selection is either `multi` or
133133

134134
- `viewDate: Date`
135135

136-
Controls the year/month that will be presented in the default view when the calendar renders. By default it is the current year/month.
136+
Controls the year/month that will be presented in the default view when the calendar renders. By default it is the first day of the current year/month.
137137

138138
- `value: Date | Date[]`
139139

@@ -173,7 +173,17 @@ Controls the visibility of the dates that do not belong to the current month.
173173
- `onSelection(): Date | Date[]`
174174

175175
Event fired when a value is selected through UI interaction.
176-
Returns the selected value (depending on the type of selection).
176+
Emits the selected value (depending on the type of selection).
177+
178+
- `onViewDateChanged(): IViewDateChangeEventArgs`
179+
180+
Event fired after the the month/year presented in the view is changed.
181+
Emits an object containing the previous and current value of the `viewDate` property.
182+
183+
- `onActiveViewChanged(): CalendarView`
184+
185+
Event fired after the active view is changed.
186+
Emits an CalendarView enum, indicating the `activeView` property value.
177187

178188

179189
### Methods

projects/igniteui-angular/src/lib/calendar/month-picker/README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ The default value is `en`.
8888

8989
- `viewDate: Date`
9090

91-
Controls the year/month that will be presented in the default view when the month picker renders. By default it is the current year/month.
91+
Controls the year/month that will be presented in the default view when the month picker renders. By default it is the first day of the current year/month.
9292

9393
- `value: Date`
9494

@@ -121,3 +121,13 @@ The default values are listed below.
121121

122122
Event fired when a value is selected through UI interaction.
123123
Returns the selected value (depending on the type of selection).
124+
125+
- `onViewDateChanged(): IViewDateChangeEventArgs`
126+
127+
Event fired after the the month/year presented in the view is changed.
128+
Emits an object containing the previous and current value of the `viewDate` property.
129+
130+
- `onActiveViewChanged(): CalendarView`
131+
132+
Event fired after the active view is changed.
133+
Emits an CalendarView enum, indicating the `activeView` property value.

projects/igniteui-angular/src/lib/calendar/month-picker/month-picker.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ describe('IgxMonthPicker', () => {
7676
};
7777

7878
expect(monthPicker.value).toBeUndefined();
79-
expect(monthPicker.viewDate.getDate()).toEqual(instance.viewDate.getDate());
79+
expect(monthPicker.viewDate.getDate()).toEqual(1);
8080
expect(monthPicker.locale).toEqual('en');
8181

8282
const today = new Date(Date.now());

0 commit comments

Comments
 (0)