good afternoon, I have a problem, I have my code with AngularJS and javascript but I can’t find a way to take that value in my function
I tried this for the start and end time but it does not take the values that I set from my front
function() {
console.log('Intervalo')
let horaInicio = angular.element('#horaNuevaBloqueo')
let horaFin = angular.element('#horaFinBloqueo')
let hoursActive = [horaInicio, horaFin]
const inactive = document.querySelectorAll('#inactive')
const activated = isActivated(hoursActive);
inactive.forEach(item => {
item.style.display = activated ? 'none' : 'block'
Esta es mi parte HTML
<div style="position: absolute; margin-top: auto; left: 570px;" >
<label style="font-weight: bold;" for="horaNuevaBloqueo">Hora Inicial Bloqueo:</label>
<input id="horaNuevaBloqueo" name="horaNuevaBloqueo" ng-model="horaAplicaBloqueo" type="text"
maxlength="20" ng-disabled="true" class="form-control-sm" />
<button class="btn btn-sm btn-success"
ng-click="versCtrl.fillNewHoraAplicaBloqueo(horaAplicaBloqueo)" data-toggle="modal"
data-target="#updateHoraAplicaBloqueo">Editar</button>
This is my isActivated function
function isActivated(hoursActive) {
const dates = hoursActive.map(dateString => {
const [hour, minute] = dateString.split(':')
let date = new Date()
date.setHours(hour, minute, 0, 0)
return date;
})
//let isActive = false;
const now = new Date();
return now.valueOf() >= dates[0].valueOf()
&& now.valueOf() <= dates[1].valueOf()
//return isActive;
}
Will anyone have a solution?