Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
th-app-java
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Oscar Enrique Gonzalez Escurra
th-app-java
Commits
4aa3516c
Commit
4aa3516c
authored
Nov 11, 2021
by
Joel Florentin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'giuli_001' of
https://phoebe.roshka.com/gitlab/hshah/TalentoHumano
into joel-001
parents
888607b2
b2a47f91
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
245 additions
and
46 deletions
+245
-46
curriculumsearch/src/main/java/com/roshka/controller/PostulanteController.java
+17
-4
curriculumsearch/src/main/java/com/roshka/modelo/PostulanteTecnologia.java
+1
-0
curriculumsearch/src/main/java/com/roshka/modelo/ReferenciaPersonal.java
+2
-9
curriculumsearch/src/main/java/com/roshka/repositorio/EstudioRepository.java
+4
-0
curriculumsearch/src/main/java/com/roshka/repositorio/ExperienciaRepository.java
+3
-0
curriculumsearch/src/main/java/com/roshka/repositorio/PostulanteRepository.java
+2
-0
curriculumsearch/src/main/java/com/roshka/repositorio/PostulanteTecnologiaRepository.java
+4
-1
curriculumsearch/src/main/resources/static/main.js
+115
-10
curriculumsearch/src/main/webapp/jsp/postulante-form.jsp
+97
-22
No files found.
curriculumsearch/src/main/java/com/roshka/controller/PostulanteController.java
View file @
4aa3516c
...
...
@@ -55,6 +55,8 @@ public class PostulanteController {
InstitucionRepository
institucionRepository
;
DepartamentoRepository
depRepo
;
CiudadRepository
ciuRepo
;
EstudioRepository
estudioRepository
;
PostulanteTecnologiaRepository
postulanteTecnologiaRepository
;
ConvocatoriaRepository
cargoRepo
;
CargoRepository
carRepo
;
...
...
@@ -62,13 +64,17 @@ public class PostulanteController {
public
PostulanteController
(
PostulanteRepository
post
,
TecnologiaRepository
tecRepo
,
ExperienciaRepository
expRepo
,
InstitucionRepository
institucionRepository
,
DepartamentoRepository
depRepo
,
CiudadRepository
ciuRepo
,
ConvocatoriaRepository
cargoRepo
,
CargoRepository
carRepo
)
{
CiudadRepository
ciuRepo
,
EstudioRepository
estudioRepository
,
PostulanteTecnologiaRepository
postulanteTecnologiaRepository
,
ConvocatoriaRepository
cargoRepo
,
CargoRepository
carRepo
)
{
this
.
post
=
post
;
this
.
tecRepo
=
tecRepo
;
this
.
expRepo
=
expRepo
;
this
.
institucionRepository
=
institucionRepository
;
this
.
depRepo
=
depRepo
;
this
.
ciuRepo
=
ciuRepo
;
this
.
estudioRepository
=
estudioRepository
;
this
.
postulanteTecnologiaRepository
=
postulanteTecnologiaRepository
;
this
.
cargoRepo
=
cargoRepo
;
this
.
carRepo
=
carRepo
;
}
...
...
@@ -140,17 +146,24 @@ public class PostulanteController {
@PostMapping
(
value
=
"/postulante"
,
consumes
=
"application/json"
)
public
String
guardarPostulante
(
@RequestBody
Postulante
postulante
){
//Codigo encargado de modificar postulacion si se envia mismo CI
Postulante
postulantex
=
post
.
findByNroDocument
(
postulante
.
getnroDocument
());
if
(
postulantex
!=
null
){
estudioRepository
.
findByPostulante
(
postulantex
).
forEach
(
x
->
estudioRepository
.
delete
(
x
));
expRepo
.
findByPostulante
(
postulantex
).
forEach
(
x
->
expRepo
.
delete
(
x
));
postulanteTecnologiaRepository
.
findByPostulante
(
postulantex
).
forEach
(
x
->
postulanteTecnologiaRepository
.
delete
(
x
));
postulante
.
setId
(
postulantex
.
getId
());
}
postulante
.
getTecnologias
().
stream
().
filter
(
tec
->
tec
.
getTecnologia
().
getId
()
!=
0
).
forEach
(
tec
->
tec
.
setTecnologia
(
tecRepo
.
getById
(
tec
.
getTecnologia
().
getId
()))
);
);
/* for (int i = 0; i < postulante.getPostulaciones().size(); i++) {
postulante.getPostulaciones().set(i, cargoRepo.getById(postulante.getPostulaciones().get(i).getId()));
}
*/
for
(
Estudio
estudio:
postulante
.
getEstudios
()){
String
nombreIns
=
""
;
nombreIns
=
estudio
.
getInstitucion
().
getNombre
().
toLowerCase
();
...
...
curriculumsearch/src/main/java/com/roshka/modelo/PostulanteTecnologia.java
View file @
4aa3516c
...
...
@@ -33,6 +33,7 @@ public class PostulanteTecnologia {
@JoinColumn
private
Tecnologia
tecnologia
;
@ManyToOne
()
@JoinColumn
@JsonBackReference
(
value
=
"postulantetecnologia-postulante"
)
...
...
curriculumsearch/src/main/java/com/roshka/modelo/ReferenciaPersonal.java
View file @
4aa3516c
package
com
.
roshka
.
modelo
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
import
javax.persistence.Id
;
import
javax.persistence.JoinColumn
;
import
javax.persistence.ManyToOne
;
import
javax.persistence.Table
;
import
javax.persistence.*
;
import
javax.validation.constraints.NotBlank
;
import
com.fasterxml.jackson.annotation.JsonBackReference
;
...
...
@@ -31,7 +24,7 @@ public class ReferenciaPersonal {
@Column
(
name
=
"relacion"
)
private
String
relacion
;
@ManyToOne
(
optional
=
false
)
@ManyToOne
(
cascade
=
CascadeType
.
ALL
,
optional
=
false
)
@JoinColumn
@JsonBackReference
private
Postulante
postulante
;
...
...
curriculumsearch/src/main/java/com/roshka/repositorio/EstudioRepository.java
View file @
4aa3516c
package
com
.
roshka
.
repositorio
;
import
com.roshka.modelo.Postulante
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
com.roshka.modelo.Estudio
;
import
java.util.List
;
public
interface
EstudioRepository
extends
JpaRepository
<
Estudio
,
Long
>{
public
List
<
Estudio
>
findByPostulante
(
Postulante
postulante
);
}
curriculumsearch/src/main/java/com/roshka/repositorio/ExperienciaRepository.java
View file @
4aa3516c
package
com
.
roshka
.
repositorio
;
import
com.roshka.modelo.Postulante
;
import
org.springframework.data.jpa.repository.JpaRepository
;
...
...
@@ -9,4 +10,6 @@ import com.roshka.modelo.Experiencia;
public
interface
ExperienciaRepository
extends
JpaRepository
<
Experiencia
,
Long
>
{
public
List
<
Experiencia
>
findByCargoLike
(
String
cargo
);
public
List
<
Experiencia
>
findByPostulante
(
Postulante
postulante
);
}
curriculumsearch/src/main/java/com/roshka/repositorio/PostulanteRepository.java
View file @
4aa3516c
...
...
@@ -14,6 +14,8 @@ import com.roshka.modelo.Postulante;
public
interface
PostulanteRepository
extends
JpaRepository
<
Postulante
,
Long
>
{
public
Postulante
findByNroDocument
(
String
ci
);
@Query
(
"select p from Postulante p join p.estudios e on e.institucion.nombre LIKE %?1%"
)
public
List
<
Postulante
>
findByInstitucionEstudio
(
String
institucion
);
...
...
curriculumsearch/src/main/java/com/roshka/repositorio/PostulanteTecnologiaRepository.java
View file @
4aa3516c
package
com
.
roshka
.
repositorio
;
import
com.roshka.modelo.Postulante
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
com.roshka.modelo.PostulanteTecnologia
;
public
interface
PostulanteTecnologiaRepository
extends
JpaRepository
<
PostulanteTecnologia
,
Long
>{
import
java.util.List
;
public
interface
PostulanteTecnologiaRepository
extends
JpaRepository
<
PostulanteTecnologia
,
Long
>{
public
List
<
PostulanteTecnologia
>
findByPostulante
(
Postulante
postulante
);
}
curriculumsearch/src/main/resources/static/main.js
View file @
4aa3516c
var
cont_experiencia
=
0
;
let
cont_estudios
=
0
;
let
cont_tecnologia
=
0
;
let
cont_cargo
=
0
;
const
experiencias
=
[];
const
estudios
=
[];
const
tecnologias
=
[];
let
noValidateFlag
=
false
;
const
postulaciones
=
[];
var
cont_referencias
=
0
;
const
referencias
=
[];
const
formValidator
=
function
()
{
'use strict'
...
...
@@ -22,6 +30,7 @@ const formValidator = function () {
if
(
!
form
.
checkValidity
())
{
event
.
preventDefault
()
event
.
stopPropagation
()
noValidateFlag
=
true
;
}
form
.
classList
.
add
(
'was-validated'
)
...
...
@@ -194,6 +203,8 @@ function serializeJSON (form) {
pairs
[
"estudios"
]
=
estudios
.
filter
(
est
=>
est
)
//eliminacion de nulos
pairs
[
"tecnologias"
]
=
tecnologias
.
filter
(
tec
=>
tec
)
//eliminacion de nulos
pairs
[
"postulaciones"
]
=
postulaciones
.
filter
(
car
=>
car
)
//eliminacion de nulos
pairs
[
"referencias"
]
=
referencias
.
filter
(
tec
=>
tec
)
// Return the JSON string
return
JSON
.
stringify
(
pairs
,
null
,
2
);
...
...
@@ -228,15 +239,18 @@ form.addEventListener("submit",(evt)=>{
// evt.stopPropagation()
// }
// form.classList.add('was-validated')
postData
(
'postulante'
,
serializeJSON
(
form
))
.
then
(
response
=>
{
if
(
response
.
status
==
200
||
response
.
status
==
302
){
location
.
replace
(
response
.
url
);
}
else
{
console
.
log
(
response
.
text
().
then
(
value
=>
console
.
log
(
value
)))
}
});
evt
.
preventDefault
();
if
(
!
noValidateFlag
){
postData
(
'postulante'
,
serializeJSON
(
form
))
.
then
(
response
=>
{
if
(
response
.
status
==
200
||
response
.
status
==
302
){
location
.
replace
(
response
.
url
);
}
else
{
console
.
log
(
response
.
text
().
then
(
value
=>
console
.
log
(
value
)))
}
});
evt
.
preventDefault
();
}
noValidateFlag
=
false
}
);
document
.
querySelector
(
"#btn-new-tech"
).
addEventListener
(
'click'
,()
=>
{
document
.
querySelector
(
"#tecnologia-nombre"
).
classList
.
remove
(
'd-none'
)})
...
...
@@ -321,6 +335,10 @@ function agregarFieldEstudio(){
}
function
eliminarEstudio
(
event
)
{
//eliminar del array
estudios
[
event
.
target
.
parentElement
.
id
.
split
(
"-"
)[
1
]]
=
null
...
...
@@ -361,6 +379,15 @@ function agregarFieldCargo(){
pairs
[
name
]
=
value
}
console
.
log
(
pairs
)
for
(
let
i
=
0
;
i
<
cont_cargo
;
i
++
){
if
(
postulaciones
[
i
]
!==
null
){
if
(
postulaciones
[
i
][
"id"
]
===
pairs
[
"cargo-id"
]){
alert
(
"Ya has agregado ese cargo!"
)
cont_cargo
--
;
return
;
}
}
}
postulaciones
[
cont_cargo
]
=
{}
postulaciones
[
cont_cargo
][
"id"
]
=
pairs
[
"cargo-id"
]
//postulaciones[cont_cargo]["cargo"]=pairs["cargo-id"]=="-1"?{nombre: pairs["cargo-nombre"]}:{id: pairs["cargo-id"],nombre:document.querySelector('[name=cargo-id] > option[value="'+pairs["cargo-id"]+'"]').innerHTML}
...
...
@@ -369,7 +396,6 @@ function agregarFieldCargo(){
//imprimir lista actualizada
const
div
=
document
.
querySelector
(
"#cargos"
)
const
div1
=
document
.
createElement
(
'div'
);
console
.
log
(
postulaciones
[
0
])
let
content1
=
'<ul>'
for
(
let
index
=
0
;
index
<
postulaciones
.
length
;
index
++
)
{
...
...
@@ -424,3 +450,82 @@ function listarCiudades(depId){
}
function
agregarFieldReferencia
(
event
){
//recoger del form
const
pairs
=
{};
const
formexp
=
document
.
querySelector
(
"[name=referencia-form]"
);
const
formData
=
new
FormData
(
formexp
);
const
referenciaPersonal
=
[{},{},{}];
let
pos_rec
;
let
returnFlag
=
false
;
let
requiredValues
=
[
"nombre"
,
"relacion"
,
"telefono"
]
formData
.
forEach
((
value
,
key
)
=>
{
if
(
requiredValues
.
includes
(
key
)
&&
value
===
""
&&
returnFlag
==
false
){
console
.
log
(
key
,
value
)
returnFlag
=
true
;
}
});
if
(
returnFlag
===
true
){
let
message
=
"Rellene "
for
(
let
i
=
0
;
i
<
requiredValues
.
length
;
i
++
){
message
+=
", "
+
requiredValues
[
i
];
}
message
+=
" como minimo."
alert
(
message
);
return
;
}
for
(
const
[
name
,
value
]
of
formData
){
pos_rec
=
name
.
split
(
"-"
);
//rec-nombre-index
if
(
pos_rec
.
length
>
1
)
{
referenciaPersonal
[
pos_rec
[
2
]][
pos_rec
[
1
]]
=
value
}
else
{
pairs
[
name
]
=
value
}
}
pairs
[
"referenciaPersonal"
]
=
referenciaPersonal
.
filter
(
rec
=>
rec
.
nombre
);
referencias
[
cont_referencias
]
=
pairs
;
formexp
.
reset
();
//imprimir lista actualizada
const
div
=
document
.
querySelector
(
"#referencia"
)
const
div1
=
document
.
createElement
(
'div'
);
let
content
=
'<ul>'
for
(
let
index
=
0
;
index
<
referencias
.
length
;
index
++
)
{
const
exp
=
referencias
[
index
];
if
(
exp
==
null
)
continue
;
content
+=
`
<li id="exp-
${
index
}
">
${
exp
.
nombre
}
<button type="button" onclick="eliminarReferencia(event)"> <span class="glyphicon glyphicon-trash"></span> Tras</button>
</li>
`
}
content
+=
"</ul>"
div1
.
innerHTML
=
content
div
.
innerHTML
=
''
;
div
.
appendChild
(
div1
);
cont_referencias
++
;
}
/*----------------------------------------------------------------- */
function
eliminarReferencia
(
event
)
{
//eliminar del array
referencias
[
event
.
target
.
parentElement
.
id
.
split
(
"-"
)[
1
]]
=
null
//eliminar en html
event
.
target
.
parentElement
.
remove
()
}
/*----------------------------------------------------------------- */
curriculumsearch/src/main/webapp/jsp/postulante-form.jsp
View file @
4aa3516c
...
...
@@ -234,11 +234,11 @@
<div
class=
"inputs col-md-6"
>
<label
for=
"nivelIngles"
class=
"form-label"
>
Nivel de ingles
</label>
<select
name=
"nivelIngles"
id=
"nivelIngles"
class=
"bg-light"
>
<option
value=
"1"
selected
>
1
</option>
<option
value=
"2"
>
2
</option>
<option
value=
"3"
>
3
</option>
<option
value=
"4"
>
4
</option>
<option
value=
"5"
>
5
</option>
<option
value=
"1"
selected
>
Ingles muy basico
</option>
<option
value=
"2"
>
Comprendo algunas cosas y puedo leer con la ayuda del traductor
</option>
<option
value=
"3"
>
Puedo leer tranquilamente
</option>
<option
value=
"4"
>
Puedo escribir documentacion
</option>
<option
value=
"5"
>
Puedo escribir y hablar tranquilamente
</option>
</select>
</div>
...
...
@@ -288,14 +288,20 @@
<div
class=
" inputs d-flex justify-content-between align-items-center experience"
><span
class=
"border px-3 p-1 add-experience"
data-toggle=
"modal"
data-target=
"#tecnologiaForm"
><i
class=
"fa fa-plus"
></i>
Agregar Tecnologia
</span></div><br>
</div>
<div
class=
"mt-3 gap-2 d-flex justify-content-between"
id=
"tecnologias"
>
</div>
<div
class=
"inputs p-3 py-5"
>
<div
class=
" inputs d-flex justify-content-between align-items-center experience"
><span
class=
"border px-3 p-1 add-experience"
data-toggle=
"modal"
data-target=
"#referenciaForm"
><i
class=
"fa fa-plus"
></i>
Referencias Personales
</span></div><br>
</div>
<div
class=
"mt-3 gap-2 d-flex justify-content-between"
id=
"referencia"
>
</div>
<div
class=
"mt-3 gap-2 d-flex justify-content-end"
>
<
button
class=
"px-3 btn btn-sm btn-outline-primary"
>
Cancelar
</button>
<
a
class=
"px-3 btn btn-sm btn-outline-primary"
href=
"/postulante"
>
Cancelar
</a>
<button
class=
"px-3 btn btn-sm btn-primary"
type=
"submit"
>
Guardar
</button>
</div>
</div>
...
...
@@ -348,22 +354,22 @@
<form
name=
"experiencia-form"
class=
"needs-validation"
novalidate
>
<div
class=
"inputs"
>
<label
for=
"institucion"
class=
"inputs form-label"
>
Institucion
</label>
<input
type=
"text"
class=
"inputs form-control "
name=
"institucion"
id=
"institucion"
required
>
<label
for=
"institucion
Experiencia
"
class=
"inputs form-label"
>
Institucion
</label>
<input
type=
"text"
class=
"inputs form-control "
name=
"institucion"
id=
"institucion
Experiencia
"
required
>
</div>
<div
class=
"inputs"
>
<label
for=
"fechaDesde"
class=
"form-label"
>
Fecha Desde
</label>
<input
type=
"date"
class=
"form-control
"
name=
"fechaDesde"
id=
"fechaDesde
"
required
>
<label
for=
"fechaDesde
Experiencia
"
class=
"form-label"
>
Fecha Desde
</label>
<input
type=
"date"
class=
"form-control
"
name=
"fechaDesde"
id=
"fechaDesdeExperiencia
"
required
>
</div>
<div
class=
"inputs"
>
<label
for=
"fechaHasta"
class=
"form-label"
>
Fecha Hasta
</label>
<input
type=
"date"
class=
"form-control
"
name=
"fechaHasta"
id=
"fechaHast
a"
>
<label
for=
"fechaHasta
Experiencia
"
class=
"form-label"
>
Fecha Hasta
</label>
<input
type=
"date"
class=
"form-control
"
name=
"fechaHasta"
id=
"fechaHastaExperienci
a"
>
</div>
<div
class=
"inputs"
>
<label
for=
"cargo"
class=
"form-label"
>
Cargo
</label>
<input
type=
"text"
class=
"form-control
"
name=
"cargo"
id=
"cargo"
required
>
<input
type=
"text"
class=
"form-control "
name=
"cargo"
id=
"cargo"
required
>
</div>
<div
class=
"inputs"
>
...
...
@@ -431,7 +437,7 @@
<input
type=
"text"
class=
"form-control d-none"
name=
"tecnologia-nombre"
id=
"tecnologia-nombre"
>
<label
for=
"nivel"
class=
"form-label"
>
Nivel
</label>
<input
type=
"
number"
class=
"form-control"
name=
"nivel"
id=
"nivel
"
required
>
<input
type=
"
range"
class=
"form-range"
name=
"nivel"
id=
"nivel"
min=
"1"
max=
"5
"
required
>
</form>
</div>
<div
class=
"modal-footer"
>
...
...
@@ -470,8 +476,8 @@
<
%
--
<
label
for=
"tipoDeEstudio"
class=
"form-label"
>
Tipo De Estudio
</label>
--%>
<
%
--
<
input
type=
"text"
class=
"form-control "
name=
"tipoDeEstudio"
id=
"tipoDeEstudio"
>
--%>
<div
class=
"form-group"
>
<label
for=
"institucion"
class=
"form-label"
>
Institucion
</label>
<input
type=
"text"
class=
"form-control"
name=
"institucion"
id=
"institucion"
required
>
<label
for=
"institucion
Estudio
"
class=
"form-label"
>
Institucion
</label>
<input
type=
"text"
class=
"form-control"
name=
"institucion"
id=
"institucion
Estudio
"
required
>
</div>
<div
class=
"form-group"
>
<label
for=
"temaDeEstudio"
class=
"form-label"
>
Carrera/Bachiller/Tema de Curso
</label>
...
...
@@ -487,12 +493,12 @@
</select>
</div>
<div
class=
"form-group"
>
<label
for=
"fechaDesde"
class=
"form-label"
>
Fecha Desde
</label>
<input
type=
"date"
class=
"form-control "
name=
"fechaDesde"
id=
"fechaDesde"
required
>
<label
for=
"fechaDesde
Estudio
"
class=
"form-label"
>
Fecha Desde
</label>
<input
type=
"date"
class=
"form-control "
name=
"fechaDesde"
id=
"fechaDesde
Estudio
"
required
>
</div>
<div
class=
"form-group"
>
<label
for=
"fechaHasta"
class=
"form-label"
>
Fecha Hasta
</label>
<input
type=
"date"
class=
"form-control "
name=
"fechaHasta"
id=
"fechaHasta"
>
<label
for=
"fechaHasta
Estudio
"
class=
"form-label"
>
Fecha Hasta
</label>
<input
type=
"date"
class=
"form-control "
name=
"fechaHasta"
id=
"fechaHasta
Estudio
"
>
</div>
...
...
@@ -507,6 +513,44 @@
</div>
<meta
name=
"_csrf"
content=
"${_csrf.token}"
/>
<meta
name=
"_csrf_header"
content=
"${_csrf.headerName}"
/>
<!--Modal de referencias-->
<div
class=
"modal fade"
id=
"referenciaForm"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"referenciaForm"
aria-hidden=
"true"
>
<div
class=
"modal-dialog"
role=
"document"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
>
<h5
class=
"modal-title"
id=
"exampleModalLabel"
>
Referencias Personales
</h5>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-label=
"Close"
>
<span
aria-hidden=
"true"
>
×
</span>
</button>
</div>
<div
class=
"modal-body"
>
<form
name=
"referencia-form"
class=
"needs-validation"
novalidate
>
<div
class=
"form-group"
>
<label
for=
"nombre"
class=
"form-label"
>
Nombre
</label>
<input
type=
"text"
class=
"form-control"
name=
"nombre"
id=
"nombre"
required
>
</div>
<div
class=
"form-group"
>
<label
for=
"relacion"
class=
"form-label"
>
Relacion
</label>
<input
type=
"text"
class=
"form-control"
name=
"relacion"
id=
"relacion"
required
>
</div>
<div
class=
"form-group"
>
<label
for=
"telefono"
class=
"form-label"
>
Telefono
</label>
<input
type=
"number"
class=
"form-control"
name=
"telefono"
id=
"telefono"
required
>
</div>
</form>
</div>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-secondary"
data-dismiss=
"modal"
>
Cerrar
</button>
<button
type=
"button"
class=
"btn btn-primary"
onclick=
"agregarFieldReferencia()"
data-dismiss=
"modal"
>
Agregar
</button>
</div>
</div>
</div>
</div>
<!-- Optional JavaScript; choose one of the two! -->
...
...
@@ -516,7 +560,38 @@
<script
src=
"https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"
integrity=
"sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy"
crossorigin=
"anonymous"
></script>
<script>
var
ciudades
=
$
{
ciudades
};
(
function
(){
var
today
=
new
Date
();
var
dd
=
today
.
getDate
();
var
mm
=
today
.
getMonth
()
+
1
;
//January is 0!
var
yyyy
=
today
.
getFullYear
();
if
(
dd
<
10
)
{
dd
=
'0'
+
dd
;
}
if
(
mm
<
10
)
{
mm
=
'0'
+
mm
;
}
today
=
yyyy
+
'-'
+
mm
+
'-'
+
dd
;
let
fechaDesdeEstudio
=
document
.
querySelector
(
"#fechaDesdeEstudio"
);
let
fechaDesdeExperiencia
=
document
.
querySelector
(
"#fechaDesdeExperiencia"
);
let
fechaHastaEstudio
=
document
.
querySelector
(
"#fechaHastaEstudio"
);
let
fechaHastaExperiencia
=
document
.
querySelector
(
"#fechaHastaExperiencia"
);
fechaDesdeEstudio
.
setAttribute
(
"max"
,
today
);
fechaDesdeExperiencia
.
setAttribute
(
"max"
,
today
);
fechaDesdeExperiencia
.
addEventListener
(
"change"
,
()
=>
{
fechaHastaExperiencia
.
setAttribute
(
"min"
,
fechaDesdeExperiencia
.
value
)
})
fechaDesdeEstudio
.
addEventListener
(
"change"
,
()
=>
{
fechaHastaEstudio
.
setAttribute
(
"min"
,
fechaDesdeEstudio
.
value
)
})
})()
</script>
<script
src=
"./main.js"
></script>
</body>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment