Skip to content

Commit

Permalink
Merge pull request #8 from vesrah/bugfix/12hr-display
Browse files Browse the repository at this point in the history
Fix hour display on 24hr and 12hr.
  • Loading branch information
SteveDunlap13 committed Jan 9, 2018
2 parents 726f71c + e4e5c07 commit b7f2960
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/time-control/w-time/w-time.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,14 @@ export class WTimeComponent implements OnInit {

public formatHour(): string {

if (this.userTime.hour === 24) {
return '00';
} else if (this.userTime.hour < 12) {
return '0' + String(this.userTime.hour);
} else {
return String(this.userTime.hour);
if (this.userTime.format === 24) {
if (this.userTime.hour === 24) {
return '00';
} else if (this.userTime.hour < 10) {
return '0' + String(this.userTime.hour);
}
}
return String(this.userTime.hour);
}

public formatMinute(): string {
Expand Down

0 comments on commit b7f2960

Please sign in to comment.