Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: corrección formato de fecha reinicio para titan #92

Merged
merged 3 commits into from
Jan 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions models/reinicio.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package models
import (
"fmt"
"strconv"
"time"

"github.com/astaxie/beego"
"github.com/udistrital/utils_oas/request"
Expand Down Expand Up @@ -309,8 +308,6 @@ func GetNovedadReinicio(novedad map[string]interface{}) (novedadformatted map[st

func ReplicaReinicio(novedad map[string]interface{}, idStr string) (result map[string]interface{}, outputError map[string]interface{}) {

fechaReinicio, _ := time.Parse("2006-01-02 15:04:05", fmt.Sprint(novedad["FechaReinicio"]))

ArgoReinicioPost := make(map[string]interface{})
ArgoReinicioPost = map[string]interface{}{
"NumeroContrato": novedad["NumeroContrato"],
Expand All @@ -326,7 +323,7 @@ func ReplicaReinicio(novedad map[string]interface{}, idStr string) (result map[s
TitanReinicioPost := make(map[string]interface{})
TitanReinicioPost = map[string]interface{}{
"Documento": novedad["Documento"],
"FechaReinicio": fechaReinicio.Format("2006-01-02T05:00:00.000Z"),
"FechaReinicio": FormatFechaTitan(novedad["FechaReinicio"].(string)),
"NumeroContrato": novedad["NumeroContrato"],
"Vigencia": novedad["Vigencia"],
}
Expand Down
1 change: 0 additions & 1 deletion models/temporizador.go
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,6 @@ func CalcularFechaFin(fechaInicio time.Time, diasNovedad float64) (fechaFin time

func FormatFechaTitan(fecha string) string {
var fechaTitan = ""
fmt.Println(fecha)
if fechaParse, err := time.Parse("2006-01-02T15:04:05.000Z", fecha); err == nil {
fechaFormat := fechaParse.Format("2006-01-02T15:04:05.000Z")
// ("2006-01-02T15:04:05.000Z")
Expand Down
4 changes: 2 additions & 2 deletions swagger/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,7 @@
}
},
"definitions": {
"43344.0xc0004262a0.false": {
"43344.0xc0004aa870.false": {
"title": "false",
"type": "object"
},
Expand All @@ -807,7 +807,7 @@
"type": "object",
"properties": {
"Body": {
"$ref": "#/definitions/43344.0xc0004262a0.false"
"$ref": "#/definitions/43344.0xc0004aa870.false"
},
"Code": {
"type": "string"
Expand Down
4 changes: 2 additions & 2 deletions swagger/swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -528,15 +528,15 @@ definitions:
'{}':
title: '{}'
type: object
43344.0xc0004262a0.false:
43344.0xc0004aa870.false:
title: "false"
type: object
models.Alert:
title: Alert
type: object
properties:
Body:
$ref: '#/definitions/43344.0xc0004262a0.false'
$ref: '#/definitions/43344.0xc0004aa870.false'
Code:
type: string
Type:
Expand Down