Skip to content

Commit

Permalink
removed spacing from time format and updated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cjellerHypur committed Feb 7, 2019
1 parent 6e3d466 commit 14501b3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/ReactTimeSelection.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ class ReactTimeSelection extends Component {
const { isMilitaryTime, onTimeChange } = this.props;
const timeObject = {};
if (!isMilitaryTime) {
setTime = `${`0${currentHours}`.slice(-2)} : ${`0${currentMinutes}`.slice(
setTime = `${`0${currentHours}`.slice(-2)}:${`0${currentMinutes}`.slice(
-2,
)} ${meridian}`;
timeObject.hour = `0${currentHours}`.slice(-2);
timeObject.mins = `0${currentMinutes}`.slice(-2);
timeObject.mer = meridian;
} else {
setTime = `${`0${currentHours}`.slice(-2)} : ${`0${currentMinutes}`.slice(-2)}`;
setTime = `${`0${currentHours}`.slice(-2)}:${`0${currentMinutes}`.slice(-2)}`;
timeObject.hour = `0${currentHours}`.slice(-2);
timeObject.mins = `0${currentMinutes}`.slice(-2);
}
Expand Down
4 changes: 2 additions & 2 deletions src/ReactTimeSelection.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ describe('React Time Selection Component', () => {
if (currentMinutes < 10) {
minString = `0${currentMinutes}`;
}
const expectedString = `${hourString} : ${minString} ${meridian}`;
const expectedString = `${hourString}:${minString} ${meridian}`;
expect(inputValue).toBe(expectedString);
});

Expand Down Expand Up @@ -281,7 +281,7 @@ describe('React Time Selection Component', () => {
if (currentMinutes < 10) {
minString = `0${currentMinutes}`;
}
const expectedString = `${hourString} : ${minString}`;
const expectedString = `${hourString}:${minString}`;
expect(inputValue).toBe(expectedString);
});

Expand Down

0 comments on commit 14501b3

Please sign in to comment.