Skip to content

Commit

Permalink
fixing b-278
Browse files Browse the repository at this point in the history
  • Loading branch information
vlio20 committed Nov 2, 2017
1 parent bd5fdf4 commit 5bfe724
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
11 changes: 11 additions & 0 deletions e2e/daytimepicker-e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {DemoPage} from './app.po';
import {browser} from 'protractor';

describe('dpDayPicker daytimePicker', () => {
let page: DemoPage;
Expand Down Expand Up @@ -61,4 +62,14 @@ describe('dpDayPicker daytimePicker', () => {
expect(page.meridiemUpBtn.getAttribute('disabled')).toBe('true');
expect(page.meridiemDownBtn.getAttribute('disabled')).toBe('true');
});

it('should check that the max selectable option is working', () => {
page.daytimePickerInput.click();
page.daytimePickerInput.sendKeys('11-04-2017 09:08:07');
expect(page.selectedDays.count()).toEqual(1);
page.daytimePickerInput.clear();
page.daytimePickerInput.sendKeys(' ');

expect(page.selectedDays.count()).toEqual(0);
});
});
5 changes: 3 additions & 2 deletions src/app/day-calendar/day-calendar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,13 +157,14 @@ export class DayCalendarComponent implements OnInit, OnChanges, ControlValueAcce
if (value) {
this.selected = this.utilsService
.convertToMomentArray(value, this.componentConfig.format, this.componentConfig.allowMultiSelect);
this.weeks = this.dayCalendarService
.generateMonthArray(this.componentConfig, this.currentDateView, this.selected);
this.inputValueType = this.utilsService
.getInputType(this.inputValue, this.componentConfig.allowMultiSelect);
} else {
this.selected = [];
}

this.weeks = this.dayCalendarService
.generateMonthArray(this.componentConfig, this.currentDateView, this.selected);
}

registerOnChange(fn: any): void {
Expand Down

0 comments on commit 5bfe724

Please sign in to comment.