Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

Fix timepicker timeformat required #1736

Merged
merged 32 commits into from
Jun 30, 2018
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
3f4222e
Resolving Card action bar still visable after hiding with *ngIf #1421
blackbaud-conorwright Mar 7, 2018
a450054
Addressed PR style comments
blackbaud-conorwright Mar 8, 2018
4b809aa
Merge remote-tracking branch 'upstream/master'
blackbaud-conorwright Mar 9, 2018
d55f351
Merge branch 'master' into master
Blackbaud-SteveBrush Mar 9, 2018
833bcc7
Merge remote-tracking branch 'upstream/master'
blackbaud-conorwright Mar 12, 2018
b553659
Merge remote-tracking branch 'upstream/master'
blackbaud-conorwright Mar 15, 2018
ab82ba3
Merge remote-tracking branch 'upstream/master'
blackbaud-conorwright Mar 19, 2018
db21c76
Merge remote-tracking branch 'upstream/master'
blackbaud-conorwright Mar 27, 2018
a282a86
Merge remote-tracking branch 'upstream/master'
blackbaud-conorwright Mar 30, 2018
d210c2b
Merge remote-tracking branch 'upstream/master'
blackbaud-conorwright Apr 10, 2018
35e789d
Merge remote-tracking branch 'upstream/master'
blackbaud-conorwright Apr 17, 2018
636c5dd
Merge remote-tracking branch 'upstream/master'
blackbaud-conorwright Apr 23, 2018
bdc97a6
Merge remote-tracking branch 'upstream/master'
blackbaud-conorwright May 1, 2018
6104aaf
Merge remote-tracking branch 'upstream/master'
blackbaud-conorwright May 2, 2018
37f50ec
Merge remote-tracking branch 'upstream/master'
blackbaud-conorwright May 8, 2018
76279cd
Merge remote-tracking branch 'upstream/master'
blackbaud-conorwright May 14, 2018
2324e90
Merge remote-tracking branch 'upstream/master'
blackbaud-conorwright May 16, 2018
d48b8f2
Merge remote-tracking branch 'upstream/master'
blackbaud-conorwright May 23, 2018
b2e318a
Merge remote-tracking branch 'upstream/master'
blackbaud-conorwright May 25, 2018
8d52945
Merge remote-tracking branch 'upstream/master'
blackbaud-conorwright May 25, 2018
194e01f
Merge remote-tracking branch 'upstream/master'
blackbaud-conorwright Jun 6, 2018
2d5e1e4
Merge remote-tracking branch 'upstream/master'
blackbaud-conorwright Jun 12, 2018
9eb6aaa
Merge remote-tracking branch 'upstream/master'
blackbaud-conorwright Jun 13, 2018
7b88609
made timeFormat optional as the docs state
blackbaud-conorwright Jun 13, 2018
36c4c43
added setters and getters for timeFormat
blackbaud-conorwright Jun 22, 2018
d0c2c31
removed unnecessary line
blackbaud-conorwright Jun 26, 2018
8ca0ce3
Merge remote-tracking branch 'upstream/master' into fix-timepicker-ti…
blackbaud-conorwright Jun 26, 2018
6d6f4ba
Merge remote-tracking branch 'upstream/master' into fix-timepicker-ti…
blackbaud-conorwright Jun 29, 2018
b4154a5
Merge remote-tracking branch 'upstream/master' into fix-timepicker-ti…
blackbaud-conorwright Jun 29, 2018
813c5f1
moved default timeformat to getter
blackbaud-conorwright Jun 29, 2018
4caf683
Merge branch 'master' into fix-timepicker-timeformat-required
Blackbaud-SteveBrush Jun 29, 2018
4819eea
Merge branch 'master' into fix-timepicker-timeformat-required
Blackbaud-SteveBrush Jun 29, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/demos/timepicker/timepicker-demo.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ <h3>
<input
type="hidden"
[skyTimepickerInput]="timePickerExample3"
[timeFormat]="format24"
[returnFormat]="returnFormat"
[(ngModel)]="selectedTime3"
#time3="ngModel">
Expand Down
12 changes: 11 additions & 1 deletion src/modules/timepicker/timepicker-component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ describe('Timepicker', () => {
let units = sections.item(0).querySelectorAll('.sky-timepicker-column');
let hours = units.item(0).querySelectorAll('button');
let minutes = units.item(1).querySelectorAll('button');
if (component.timeFormat === 'hh') {
if (component.timeFormat === 'hh' || !component.timeFormat) {
let meridies = units.item(2).querySelectorAll('button');
expect(hours.item(0)).toHaveText('1');
expect(hours.item(11)).toHaveText('12');
Expand All @@ -108,6 +108,16 @@ describe('Timepicker', () => {
}
}

it('should default to the twelve hour timepicker without timeFormat', fakeAsync(() => {
fixture.detectChanges();
component.timeFormat = undefined;
fixture.detectChanges();
tick();
fixture.detectChanges();
openTimepicker(nativeElement, fixture);
verifyTimepicker(nativeElement);
}));

it('should have the twelve hour timepicker', fakeAsync(() => {
fixture.detectChanges();
component.timeFormat = 'hh';
Expand Down
8 changes: 7 additions & 1 deletion src/modules/timepicker/timepicker.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,18 @@ export class SkyTimepickerInputDirective implements
OnInit, OnDestroy, ControlValueAccessor, Validator, OnChanges {

public pickerChangedSubscription: Subscription;
private _timeFormat: string = 'hh';

@Input()
public skyTimepickerInput: SkyTimepickerComponent;

@Input()
public timeFormat: string;
public set timeFormat(value: string) {
this._timeFormat = value;
}
public get timeFormat(): string {
return this._timeFormat || 'hh';
}

@Input()
public returnFormat: string;
Expand Down