Merge pull request #1573 from bramley/correct_good_afternoon

Welcome message displays "good night" in the afternoon
This commit is contained in:
Diego Najar 2024-08-06 22:40:05 +02:00 committed by GitHub
commit 151c5ab482
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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>');