Skip to content

Commit

Permalink
fix datetimepicker tests parser (#1697)
Browse files Browse the repository at this point in the history
  • Loading branch information
JKMarkowski committed Dec 3, 2019
1 parent 310286c commit 975387b
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,17 @@ describe('DatetimePickerComponent', () => {
let component: DatetimePickerComponent;
let fixture: ComponentFixture<DatetimePickerComponent>;

const takeAtLeastTwoDigits = (digit: number): string => {
return digit < 10 ? '0' + digit : String(digit);
};

const internalParser = (date: FdDatetime): string => {
return date.month + '/' +
date.day + '/' +
return takeAtLeastTwoDigits(date.month) + '/' +
takeAtLeastTwoDigits(date.day) + '/' +
date.year + ', ' +
date.hour + ':' +
date.minute + ':' +
date.second
takeAtLeastTwoDigits(date.hour) + ':' +
takeAtLeastTwoDigits(date.minute) + ':' +
takeAtLeastTwoDigits(date.second)
;
};

Expand Down

0 comments on commit 975387b

Please sign in to comment.