Skip to content

Commit

Permalink
Rango de edad con base en edad en fecha del hecho. Closes #681
Browse files Browse the repository at this point in the history
  • Loading branch information
vtamara committed Aug 8, 2024
1 parent 5349240 commit ce81456
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/javascript/controllers/edad_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,12 @@ export default class extends Controller {
for (let i = 0; i < opcionesRangoedad.length; i++) {
let opcion = this.rangoedadTarget.options[i].text;
let rango = opcion.match(/\d+/g).map(Number);
if (rango.length == 2 && edadactual >= rango[0] &&
edadactual <= rango[1]) {
if (rango.length == 2 && edad >= rango[0] &&
edad <= rango[1]) {
this.rangoedadTarget.selectedIndex = i;
break;
}
if (rango.length == 1 && edadactual >= rango[0]) {
if (rango.length == 1 && edad > = rango[0]) {
this.rangoedadTarget.selectedIndex = i;
break;
}
Expand Down

0 comments on commit ce81456

Please sign in to comment.