Skip to content

Instantly share code, notes, and snippets.

@vinayakkulkarni
Last active December 23, 2016 05:33
Show Gist options
  • Save vinayakkulkarni/c13ede2b13f273daafbb26343cb4068b to your computer and use it in GitHub Desktop.
Save vinayakkulkarni/c13ede2b13f273daafbb26343cb4068b to your computer and use it in GitHub Desktop.
Greet according to the time. Set default as afternoon.
<h1 class="gradient-text">
<span>Good afternoon.</span><br>
How can we help you today?
</h1>
var date = new Date();
if (date.getHours() < 12) {
$('.gradient-text span').html('Good Morning')
}
if (date.getHours() >= 18) {
$('.gradient-text span').html('Good Evening.')
}
if (date.getHours() >= 23) {
$('.gradient-text span').html('Good Evening.')
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment