Skip to content

Commit

Permalink
feat: add format hours
Browse files Browse the repository at this point in the history
  • Loading branch information
ialexanderbrito committed Oct 11, 2022
1 parent 26053c2 commit a514f0d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/utils/formatHours.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export function formatHours(horario: string) {
const hora = horario.split(':')[0];
const minuto = horario.split(':')[1];

if (hora.length === 1) {
return `0${hora}:${minuto}`;
}

return `${hora}:${minuto}`;
}

0 comments on commit a514f0d

Please sign in to comment.