Skip to content

Commit

Permalink
merge develop into main (#99)
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanvit authored May 22, 2024
2 parents ec6ea85 + 8818ce1 commit cba9470
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 16 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
[2.10.1] - 2024-05-22
### Fixed
- Incorrect event end times [#97](https://github.com/rokwire/gateway-building-block/issues/97)

[2.10.0] - 2024-05-16
### Changed
- Handle location processing on WebTools import [#90](https://github.com/rokwire/gateway-building-block/issues/90)
Expand Down
4 changes: 2 additions & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
Patches for **Gateway Building Block** in this repository will only be applied to the following versions:
| Version | Supported |
| ------- | ------------------ |
| 2.10.0 | :white_check_mark: |
| < 2.10.0 | :x: |
| 2.10.1 | :white_check_mark: |
| < 2.10.1 | :x: |

## Reporting a Bug or Vulnerability

Expand Down
36 changes: 24 additions & 12 deletions core/logic_events.go
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ func (e eventsLogic) constructLegacyEvent(g model.WebToolsEvent, id string, now
timeType := g.TimeType

var startDate, startTime, endDate, endTime string
var startDateObj, endDateObj time.Time
var startDateObj, endDateObj *time.Time

chicagoLocation, err := time.LoadLocation("America/Chicago")
if err != nil {
Expand All @@ -595,35 +595,47 @@ func (e eventsLogic) constructLegacyEvent(g model.WebToolsEvent, id string, now
startDate = g.StartDate
startTime = g.StartTime
startDateTimeStr := fmt.Sprintf("%s %s", startDate, startTime)
startDateObj, _ = time.ParseInLocation("1/2/2006 3:04 pm", startDateTimeStr, chicagoLocation)
startDateObjTmp, _ := time.ParseInLocation("1/2/2006 3:04 pm", startDateTimeStr, chicagoLocation)
startDateObj = &startDateObjTmp

endDate = g.EndDate
/*endDate = g.EndDate
endDateTimeStr := fmt.Sprintf("%s 11:59 pm", endDate)
endDateObj, _ = time.ParseInLocation("1/2/2006 3:04 pm", endDateTimeStr, chicagoLocation)
endDateObjTmp, _ := time.ParseInLocation("1/2/2006 3:04 pm", endDateTimeStr, chicagoLocation)
endDateObj = &endDateObjTmp*/
} else if timeType == "START_AND_END_TIME" {
startDate = g.StartDate
startTime = g.StartTime
startDateTimeStr := fmt.Sprintf("%s %s", startDate, startTime)
startDateObj, _ = time.ParseInLocation("1/2/2006 3:04 pm", startDateTimeStr, chicagoLocation)
startDateObjTmp, _ := time.ParseInLocation("1/2/2006 3:04 pm", startDateTimeStr, chicagoLocation)
startDateObj = &startDateObjTmp

endDate = g.EndDate
endTime = g.EndTime
endDateTimeStr := fmt.Sprintf("%s %s", endDate, endTime)
endDateObj, _ = time.ParseInLocation("1/2/2006 3:04 pm", endDateTimeStr, chicagoLocation)
endDateObjTmp, _ := time.ParseInLocation("1/2/2006 3:04 pm", endDateTimeStr, chicagoLocation)
endDateObj = &endDateObjTmp
} else if timeType == "NONE" {
allDay = true

startDate = g.StartDate
endDate = g.EndDate
startDateTimeStr := fmt.Sprintf("%s 12:00 am", startDate)
startDateObj, _ = time.ParseInLocation("1/2/2006 3:04 pm", startDateTimeStr, chicagoLocation)
startDateObjTmp, _ := time.ParseInLocation("1/2/2006 3:04 pm", startDateTimeStr, chicagoLocation)
startDateObj = &startDateObjTmp

endDateTimeStr := fmt.Sprintf("%s 11:59 pm", endDate)
endDateObj, _ = time.ParseInLocation("1/2/2006 3:04 pm", endDateTimeStr, chicagoLocation)
/* endDateTimeStr := fmt.Sprintf("%s 11:59 pm", endDate)
endDateObjTmp, _ := time.ParseInLocation("1/2/2006 3:04 pm", endDateTimeStr, chicagoLocation)
endDateObj = &endDateObjTmp */
}

startDateStr := startDateObj.UTC().Format("Mon, 02 Jan 2006 15:04:05 GMT")
endDateStr := endDateObj.UTC().Format("Mon, 02 Jan 2006 15:04:05 GMT")
startDateStr := ""
endDateStr := ""

if startDateObj != nil {
startDateStr = startDateObj.UTC().Format("Mon, 02 Jan 2006 15:04:05 GMT")
}
if endDateObj != nil {
endDateStr = endDateObj.UTC().Format("Mon, 02 Jan 2006 15:04:05 GMT")
}

//end - start date + end date (+all day)

Expand Down
2 changes: 1 addition & 1 deletion driver/web/docs/gen/def.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ openapi: 3.0.3
info:
title: Rokwire Gateway Building Block API
description: Gateway Building Block API Documentation
version: 2.10.0
version: 2.10.1
servers:
- url: 'https://api.rokwire.illinois.edu/gateway'
description: Production server
Expand Down
2 changes: 1 addition & 1 deletion driver/web/docs/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ openapi: 3.0.3
info:
title: Rokwire Gateway Building Block API
description: Gateway Building Block API Documentation
version: 2.10.0
version: 2.10.1
servers:
- url: 'https://api.rokwire.illinois.edu/gateway'
description: Production server
Expand Down

0 comments on commit cba9470

Please sign in to comment.