I have a restaurant site that wants to publish menus at specific times and dates, it works great to set the scheduling option in the CMS item BUT it is 2 hours “behind” Sweden…
I assume it’s set to UK or CET time, and we have summertime in SE, so it makes sense that it’s 2 hours “behind” (I need to set publish 2 hours earlier than the actual time I want to publish).
Is there a way to set my specific timezone in “Settings”, or any way around this?
Only with javascript. You need to have two navbars with different classes.
Based on javascript at the bottom, we are looking on UTC timezone, and from 00:00 to 12:00 we show nav-1, and from 12:00 to 23:59 we show nav-2
function updateNavbarVisibility() {
var now = new Date();
var utcHours = now.getUTCHours();
if (utcHours >= 0 && utcHours < 12) {
$('.nav-1').show();
$('.nav-2').hide();
} else {
$('.nav-1').hide();
$('.nav-2').show();
}
}
updateNavbarVisibility();