I would like to know how I put a code to be active between certain hours, which in this case would be between 7am and 10pm in the Brasilia time zone.
I tried to study this one that already contains this function, do not understand:
var horaAtual = (new Date()).getHours();
var imagem = "";
if(horaAtual >= horario_inicio["manhã"] && horaAtual < horario_inicio
["tarde"]){
imagem = imagens["manhã"];
}else if(horaAtual >= horario_inicio["tarde"] && horaAtual <
horario_inicio["noite"]){
imagen = imagens["tarde"];
}else if(horaAtual >= horario_inicio["noite"] || horaAtual < horario_inicio
["manhã"]){
imagen = imagens["noite"];
}
if(imagem_se_repete){
jQuery(seletor_css).css("background", "url(" + imagem + ") repeat");
}else{
jQuery(seletor_css).css({"background-image":"url(" + imagem + ")",
"background-repeat":"no-repeat", "background-size":"cover"});
}
});
The code I want to set up is as follows:
$(function() {
$(".post").each(function() {
if (_userdata.user_level == 2 || _userdata.user_level == 1) {
return;
}
if($('.pathname-box:contains(Tarefas), .pathname-box:contains(Redações)').length > 0) {
var username = _userdata.username;
if ($(this).has('.staff').length) {
return;
}
if($(this).html().indexOf(username) <= 1) {
$(this).remove();
}
if($(this).html().indexOf(username) >= 1) {
$(this).remove();
}
}
});
});