Ver Mensaje Individual
  #14 (permalink)  
Antiguo 08/01/2016, 11:55
dip0813000254
 
Fecha de Ingreso: enero-2016
Ubicación: neuquen
Mensajes: 19
Antigüedad: 8 años, 4 meses
Puntos: 0
Respuesta: agregar variable a funcion de horarios

Cita:
Iniciado por IsaBelM Ver Mensaje
Porqué no muestras como lo haces??

Código Javascript:
Ver original
  1. <script language="javascript">
  2. function mensajes(){
  3.    var txthello="";
  4.    var now = new Date();
  5.    var day = now.getDay();
  6.    var hours = Number(now.toTimeString().match(/(\d{1,}:)+/)[0].replace(/(:)/g, ''));
  7.    
  8.  
  9. else if(day == 5){
  10.     if(hours >= 800 && hours <= 1224) {txthello=" Abierto";}
  11. else if(hours >= 1225 && hours <= 1525) {txthello=" Cerrado";}
  12. else if(hours >= 1525 && hours <= 2000) {txthello=" Abierto";}
  13. else if(hours >= 2000 && hours <= 2359) {txthello=" Cerrado";}
  14.     }
  15.  
  16.    document.write(txthello + '<br/>');
  17. }
  18. mensajes();
  19.    
  20. </script>

de esta manera lo hago, este es el de hoy viernes