Small bug found in admin
-
- Jr. Bludit
- Posts: 8
- Joined: Wed Dec 09, 2020 10:40 am
Hello all,
I've found a small bug in Bludit's admin panel. The welcome message shows good night when it's 12 o'clock (day time). Here's also the fix:
File: bl-kernel/admin/views/dashboard.php
<script>
$( document ).ready(function() {
$("#hello-message").fadeOut(1000, function() {
var date = new Date()
var hours = date.getHours()
if (hours > 6 && hours < 12) {
$(this).html('<span class="fa fa-sun-o"></span><?php echo $L->g('good-morning') ?>');
} else if (hours >= 12 && hours < 18) {
$(this).html('<span class="fa fa-sun-o"></span><?php echo $L->g('good-afternoon') ?>');
} else if (hours >= 18 && hours < 22) {
$(this).html('<span class="fa fa-moon-o"></span><?php echo $L->g('good-evening') ?>');
} else {
$(this).html('<span class="fa fa-moon-o"></span><span><?php echo $L->g('good-night') ?></span>');
}
}).fadeIn(1000);
});
</script>
2 = were missing
I've found a small bug in Bludit's admin panel. The welcome message shows good night when it's 12 o'clock (day time). Here's also the fix:
File: bl-kernel/admin/views/dashboard.php
<script>
$( document ).ready(function() {
$("#hello-message").fadeOut(1000, function() {
var date = new Date()
var hours = date.getHours()
if (hours > 6 && hours < 12) {
$(this).html('<span class="fa fa-sun-o"></span><?php echo $L->g('good-morning') ?>');
} else if (hours >= 12 && hours < 18) {
$(this).html('<span class="fa fa-sun-o"></span><?php echo $L->g('good-afternoon') ?>');
} else if (hours >= 18 && hours < 22) {
$(this).html('<span class="fa fa-moon-o"></span><?php echo $L->g('good-evening') ?>');
} else {
$(this).html('<span class="fa fa-moon-o"></span><span><?php echo $L->g('good-night') ?></span>');
}
}).fadeIn(1000);
});
</script>
2 = were missing
- Edi
- Site Admin
- Posts: 3121
- Joined: Sun Aug 09, 2015 5:01 pm
- Location: Zurich
- Has thanked: 54 times
- Been thanked: 77 times
- Contact:
Thank you! Can you please post the bug on the GitHub tracker of Bludit:
https://github.com/bludit/bludit/issues
https://github.com/bludit/bludit/issues
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets