Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 5bfe724

Browse files
committedNov 2, 2017
fixing b-278
1 parent bd5fdf4 commit 5bfe724

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed
 

‎e2e/daytimepicker-e2e.spec.ts

+11
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import {DemoPage} from './app.po';
2+
import {browser} from 'protractor';
23

34
describe('dpDayPicker daytimePicker', () => {
45
let page: DemoPage;
@@ -61,4 +62,14 @@ describe('dpDayPicker daytimePicker', () => {
6162
expect(page.meridiemUpBtn.getAttribute('disabled')).toBe('true');
6263
expect(page.meridiemDownBtn.getAttribute('disabled')).toBe('true');
6364
});
65+
66+
it('should check that the max selectable option is working', () => {
67+
page.daytimePickerInput.click();
68+
page.daytimePickerInput.sendKeys('11-04-2017 09:08:07');
69+
expect(page.selectedDays.count()).toEqual(1);
70+
page.daytimePickerInput.clear();
71+
page.daytimePickerInput.sendKeys(' ');
72+
73+
expect(page.selectedDays.count()).toEqual(0);
74+
});
6475
});

‎src/app/day-calendar/day-calendar.component.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -157,13 +157,14 @@ export class DayCalendarComponent implements OnInit, OnChanges, ControlValueAcce
157157
if (value) {
158158
this.selected = this.utilsService
159159
.convertToMomentArray(value, this.componentConfig.format, this.componentConfig.allowMultiSelect);
160-
this.weeks = this.dayCalendarService
161-
.generateMonthArray(this.componentConfig, this.currentDateView, this.selected);
162160
this.inputValueType = this.utilsService
163161
.getInputType(this.inputValue, this.componentConfig.allowMultiSelect);
164162
} else {
165163
this.selected = [];
166164
}
165+
166+
this.weeks = this.dayCalendarService
167+
.generateMonthArray(this.componentConfig, this.currentDateView, this.selected);
167168
}
168169

169170
registerOnChange(fn: any): void {

0 commit comments

Comments
 (0)
Please sign in to comment.