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

Conversation

blackbaud-conorwright
Copy link
Contributor

set the expected default for the optional timeFormat property on timepicker and made it use the default if set to undefined on a change.

Resolves: #846

@codecov-io
Copy link

codecov-io commented Jun 13, 2018

Codecov Report

Merging #1736 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1736   +/-   ##
=======================================
  Coverage   99.98%   99.98%           
=======================================
  Files         410      410           
  Lines        8538     8542    +4     
  Branches     1252     1253    +1     
=======================================
+ Hits         8537     8541    +4     
  Misses          1        1
Impacted Files Coverage Δ
src/modules/timepicker/timepicker.directive.ts 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 113c02c...4819eea. Read the comment docs.

@@ -57,7 +57,7 @@ export class SkyTimepickerInputDirective implements
public skyTimepickerInput: SkyTimepickerComponent;

@Input()
public timeFormat: string;
public timeFormat: string = 'hh';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could use the following, to avoid duplicating the default value throughout the class:

@Input()
public set timeFormat(value: string) {
  this._timeFormat = value;
}

public get timeFormat(): string {
  return this._timeFormat || 'hh';
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice! done.

@@ -79,6 +85,7 @@ export class SkyTimepickerInputDirective implements

public ngOnChanges(changes: SimpleChanges) {
this._validatorChange();
this.timeFormat = this.timeFormat;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@blackbaud-conorwright I don't think this line is needed? It seems redundant.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah haha, I think I originally had something else equal to it, but forgot to clean this up. nice catch

@blackbaud-conorwright
Copy link
Contributor Author

@Blackbaud-SteveBrush Can you restart this one?


@Input()
public skyTimepickerInput: SkyTimepickerComponent;

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to move the default value to the get, to make it consistent with other components?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@Blackbaud-SteveBrush Blackbaud-SteveBrush dismissed their stale review June 29, 2018 20:10

Need to a fix a bug in master first

@Blackbaud-SteveBrush Blackbaud-SteveBrush merged commit 2d75554 into master Jun 30, 2018
@Blackbaud-SteveBrush Blackbaud-SteveBrush deleted the fix-timepicker-timeformat-required branch June 30, 2018 16:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants