Display correct welcome message when hour is exactly 6, 12 or 18

This commit is contained in:
Duncan Cameron 2024-07-07 13:49:21 +01:00
parent 49fb7f03b1
commit e17583fb63

View file

@ -22,11 +22,11 @@
$("#hello-message").fadeOut(2400, function() {
var date = new Date()
var hours = date.getHours()
if (hours > 6 && hours < 12) {
if (hours >= 6 && hours < 12) {
$(this).html('<span class="fa fa-sun-o"></span><?php echo $L->g('good-morning') . ', ' . $name ?>');
} else if (hours > 12 && hours < 18) {
} else if (hours >= 12 && hours < 18) {
$(this).html('<span class="fa fa-sun-o"></span><?php echo $L->g('good-afternoon') . ', ' . $name ?>');
} else if (hours > 18 && hours < 22) {
} else if (hours >= 18 && hours < 22) {
$(this).html('<span class="fa fa-moon-o"></span><?php echo $L->g('good-evening') . ', ' . $name ?>');
} else {
$(this).html('<span class="fa fa-moon-o"></span><span><?php echo $L->g('good-night') . ', ' . $name ?></span>');