Skip to content

Commit

Permalink
feat: add utils dia da semana
Browse files Browse the repository at this point in the history
  • Loading branch information
ialexanderbrito committed Apr 4, 2022
1 parent ef49d2c commit bcdfb07
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/utils/diaDaSemana.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
export function getDiaSemana() {
const diaSemana = new Date().getDay();

switch (diaSemana) {
case 1:
return 'Segunda-feira';
case 2:
return 'Terça-feira';
case 3:
return 'Quarta-feira';
case 4:
return 'Quinta-feira';
case 5:
return 'Sexta-feira';
case 6:
return 'Sábado';
case 0:
return 'Domingo';
default:
return 'Dia';
}
}

0 comments on commit bcdfb07

Please sign in to comment.