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
c492342c
Commit
c492342c
authored
3 years ago
by
Joel Florentin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
helper para convertir fecha
parent
364b178e
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
25 deletions
+37
-25
curriculumsearch/src/main/java/com/roshka/modelo/Estudio.java
+8
-0
curriculumsearch/src/main/java/com/roshka/modelo/Experiencia.java
+3
-16
curriculumsearch/src/main/java/com/roshka/modelo/Postulante.java
+2
-9
curriculumsearch/src/main/java/com/roshka/utils/Helper.java
+24
-0
No files found.
curriculumsearch/src/main/java/com/roshka/modelo/Estudio.java
View file @
c492342c
...
...
@@ -19,6 +19,7 @@ import javax.validation.constraints.Past;
import
com.fasterxml.jackson.annotation.JsonBackReference
;
import
com.fasterxml.jackson.annotation.JsonManagedReference
;
import
com.roshka.utils.Helper
;
@Entity
@Table
(
name
=
"estudio"
)
public
class
Estudio
{
...
...
@@ -74,6 +75,13 @@ public class Estudio {
this
.
postulante
=
postulante
;
}
public
void
setFechaDesde
(
String
fechaDesde
)
{
this
.
fechaDesde
=
Helper
.
convertirFecha
(
fechaDesde
);
}
public
void
setFechaHasta
(
String
fechaHasta
)
{
this
.
fechaHasta
=
Helper
.
convertirFecha
(
fechaHasta
);
}
public
long
getId
()
{
...
...
This diff is collapsed.
Click to expand it.
curriculumsearch/src/main/java/com/roshka/modelo/Experiencia.java
View file @
c492342c
...
...
@@ -12,6 +12,7 @@ import javax.persistence.GenerationType;
import
com.fasterxml.jackson.annotation.JsonBackReference
;
import
com.fasterxml.jackson.annotation.JsonManagedReference
;
import
com.roshka.utils.Helper
;
import
javax.persistence.*
;
import
javax.validation.constraints.NotBlank
;
...
...
@@ -75,14 +76,7 @@ public class Experiencia {
this
.
fechaDesde
=
fechaDesde
;
}
public
void
setFechaDesde
(
String
fechaDesde
)
{
if
(
fechaDesde
==
null
||
fechaDesde
.
isEmpty
())
return
;
try
{
this
.
fechaDesde
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
).
parse
(
fechaDesde
);
}
catch
(
ParseException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
this
.
fechaDesde
=
Helper
.
convertirFecha
(
fechaDesde
);
}
public
Date
getFechaHasta
()
{
return
fechaHasta
;
...
...
@@ -91,14 +85,7 @@ public class Experiencia {
this
.
fechaHasta
=
fechaHasta
;
}
public
void
setFechaHasta
(
String
fechaHasta
)
{
if
(
fechaHasta
==
null
||
fechaHasta
.
isEmpty
())
return
;
try
{
this
.
fechaHasta
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
).
parse
(
fechaHasta
);
}
catch
(
ParseException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
this
.
fechaHasta
=
Helper
.
convertirFecha
(
fechaHasta
);
}
public
String
getNombreReferencia
()
{
return
nombreReferencia
;
...
...
This diff is collapsed.
Click to expand it.
curriculumsearch/src/main/java/com/roshka/modelo/Postulante.java
View file @
c492342c
...
...
@@ -4,6 +4,7 @@ import javax.persistence.*;
import
javax.validation.constraints.*
;
import
com.fasterxml.jackson.annotation.JsonManagedReference
;
import
com.roshka.utils.Helper
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
...
...
@@ -150,15 +151,7 @@ public class Postulante {
}
public
void
setFechaNacimiento
(
String
fechaNacimiento
)
{
if
(
fechaNacimiento
==
null
||
fechaNacimiento
.
isEmpty
())
return
;
try
{
this
.
fechaNacimiento
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
).
parse
(
fechaNacimiento
);
}
catch
(
ParseException
e
)
{
// TODO Auto-generated catch block
System
.
err
.
println
(
"Error al parsear"
);
e
.
printStackTrace
();
}
this
.
fechaNacimiento
=
Helper
.
convertirFecha
(
fechaNacimiento
);
}
public
String
getResumen
()
{
...
...
This diff is collapsed.
Click to expand it.
curriculumsearch/src/main/java/com/roshka/utils/Helper.java
0 → 100644
View file @
c492342c
package
com
.
roshka
.
utils
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
public
class
Helper
{
/**
* Se espera fecha en el formato yyyy-MM-dd
* @param fecha
* @return retorna fecha correcta o nulo si no es posible convertir
*/
public
static
Date
convertirFecha
(
String
fecha
)
{
try
{
return
new
SimpleDateFormat
(
"yyyy-MM-dd"
).
parse
(
fecha
);
}
catch
(
ParseException
e
)
{
// TODO Auto-generated catch block
System
.
err
.
println
(
"Error al parsear"
);
e
.
printStackTrace
();
return
null
;
}
}
}
This diff is collapsed.
Click to expand it.
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