显示的代码的目的是按时间添加一些提醒。这些案件是针对一周中的不同日子和那几天的特定时间的。奇怪的是,有些语句最不工作,但我看不出是什么破坏了代码:
function refreshTime() {
var now = getTime();
$('#date').html(now.day + ', ' + now.date + '. ' + now.month);
$('#time').html("<span class='hour'>" + now.hour + "</span>" + "<span class='minute'>" + now.minute + "</span>" + "<span class='second'>" + now.second + "</span>");
if (now.day != "Sonntag" && now.day != "Samstag")
{
if (now.hour == "9" && now.minute >= "50")
{
var left = "60" - now.minute;
$('#gh').html("<span class='gh_remind'>Grosshandel einstellen in " + left + " Minuten!</span>");
}
if (now.hour == '11' && now.minute >= '50')
{
var left = '60' - now.minute;
$('#gh').html("<span class='gh_remind'>Grosshandel einstellen in " + left + " Minuten!</span>");
}
if (now.hour == '14' && now.minute >= '50')
{
var left = '60' - now.minute;
$('#gh').html("<span class='gh_remind'>Grosshandel einstellen in " + left + " Minuten!</span>");
}
if (now.hour == "17" && now.minute >= "50")
{
var left = "60" - now.minute;
$('#gh').html("<span class='gh_remind'>Grosshandel einstellen in " + left + " Minuten!</span>");
}
else
{
$('#gh').html("");
}
}
if (now.day == "Samstag")
{
if (now.hour == "9" && now.minute >= "50")
{
var left = "60" - now.minute;
$('#gh').html("<span class='gh_remind'>Grosshandel einstellen in " + left + " Minuten!</span>");
}
if (now.hour == "12" && now.minute >= "50")
{
var left = "60" - now.minute;
$('#gh').html("<span class='gh_remind'>Grosshandel einstellen in " + left + " Minuten!</span>");
}
if (now.hour == "13" && now.minute >= "50")
{
var left = "60" - now.minute;
$('#gh').html("<span class='gh_remind'>Grosshandel einstellen in " + left + " Minuten!</span>");
}
else
{
$('#gh').html("");
}
}
}
谢谢你的帮助!