Skip to content

Commit

Permalink
I created a conditional for when the time is less than 10 and it is i…
Browse files Browse the repository at this point in the history
…n the morning, to have 0 in front.
  • Loading branch information
aline-borges committed Nov 17, 2020
1 parent 2c0d7bb commit 7f84c2b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/screens/Locations/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,12 @@ const Locations = ({ navigation }) => {

const hour = date.getUTCHours();
const minutes = date.getUTCMinutes();
let newHour = ``;

const time = `${hour}:${minutes}`;
hour < 10 ? newHour = `0${hour}` : newHour = `${hour}`
console.log(newHour)

const time = `${newHour}:${minutes}`;

const datas = {data: response, data2: response2}
const location = {
Expand Down

0 comments on commit 7f84c2b

Please sign in to comment.