Skip to content

Instantly share code, notes, and snippets.

@xbrunosousa
Created July 27, 2019 16:02
Show Gist options
  • Save xbrunosousa/7c8f102516d57d4fbc2981580b229bb4 to your computer and use it in GitHub Desktop.
Save xbrunosousa/7c8f102516d57d4fbc2981580b229bb4 to your computer and use it in GitHub Desktop.
getGreetings = () => {
const h = new Date().getHours();
if (h <= 11) {
return 'Bom dia';
} else if (h >= 12 && h <= 17) {
return 'Boa tarde';
} else if (h >= 18 && h <= 23) {
return 'Boa noite';
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment