Skip to content

Commit cba9470

Browse files
authored
merge develop into main (#99)
2 parents ec6ea85 + 8818ce1 commit cba9470

File tree

5 files changed

+32
-16
lines changed

5 files changed

+32
-16
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8+
[2.10.1] - 2024-05-22
9+
### Fixed
10+
- Incorrect event end times [#97](https://github.com/rokwire/gateway-building-block/issues/97)
11+
812
[2.10.0] - 2024-05-16
913
### Changed
1014
- Handle location processing on WebTools import [#90](https://github.com/rokwire/gateway-building-block/issues/90)

SECURITY.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
Patches for **Gateway Building Block** in this repository will only be applied to the following versions:
55
| Version | Supported |
66
| ------- | ------------------ |
7-
| 2.10.0 | :white_check_mark: |
8-
| < 2.10.0 | :x: |
7+
| 2.10.1 | :white_check_mark: |
8+
| < 2.10.1 | :x: |
99

1010
## Reporting a Bug or Vulnerability
1111

core/logic_events.go

+24-12
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ func (e eventsLogic) constructLegacyEvent(g model.WebToolsEvent, id string, now
584584
timeType := g.TimeType
585585

586586
var startDate, startTime, endDate, endTime string
587-
var startDateObj, endDateObj time.Time
587+
var startDateObj, endDateObj *time.Time
588588

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

600-
endDate = g.EndDate
601+
/*endDate = g.EndDate
601602
endDateTimeStr := fmt.Sprintf("%s 11:59 pm", endDate)
602-
endDateObj, _ = time.ParseInLocation("1/2/2006 3:04 pm", endDateTimeStr, chicagoLocation)
603+
endDateObjTmp, _ := time.ParseInLocation("1/2/2006 3:04 pm", endDateTimeStr, chicagoLocation)
604+
endDateObj = &endDateObjTmp*/
603605
} else if timeType == "START_AND_END_TIME" {
604606
startDate = g.StartDate
605607
startTime = g.StartTime
606608
startDateTimeStr := fmt.Sprintf("%s %s", startDate, startTime)
607-
startDateObj, _ = time.ParseInLocation("1/2/2006 3:04 pm", startDateTimeStr, chicagoLocation)
609+
startDateObjTmp, _ := time.ParseInLocation("1/2/2006 3:04 pm", startDateTimeStr, chicagoLocation)
610+
startDateObj = &startDateObjTmp
608611

609612
endDate = g.EndDate
610613
endTime = g.EndTime
611614
endDateTimeStr := fmt.Sprintf("%s %s", endDate, endTime)
612-
endDateObj, _ = time.ParseInLocation("1/2/2006 3:04 pm", endDateTimeStr, chicagoLocation)
615+
endDateObjTmp, _ := time.ParseInLocation("1/2/2006 3:04 pm", endDateTimeStr, chicagoLocation)
616+
endDateObj = &endDateObjTmp
613617
} else if timeType == "NONE" {
614618
allDay = true
615619

616620
startDate = g.StartDate
617-
endDate = g.EndDate
618621
startDateTimeStr := fmt.Sprintf("%s 12:00 am", startDate)
619-
startDateObj, _ = time.ParseInLocation("1/2/2006 3:04 pm", startDateTimeStr, chicagoLocation)
622+
startDateObjTmp, _ := time.ParseInLocation("1/2/2006 3:04 pm", startDateTimeStr, chicagoLocation)
623+
startDateObj = &startDateObjTmp
620624

621-
endDateTimeStr := fmt.Sprintf("%s 11:59 pm", endDate)
622-
endDateObj, _ = time.ParseInLocation("1/2/2006 3:04 pm", endDateTimeStr, chicagoLocation)
625+
/* endDateTimeStr := fmt.Sprintf("%s 11:59 pm", endDate)
626+
endDateObjTmp, _ := time.ParseInLocation("1/2/2006 3:04 pm", endDateTimeStr, chicagoLocation)
627+
endDateObj = &endDateObjTmp */
623628
}
624629

625-
startDateStr := startDateObj.UTC().Format("Mon, 02 Jan 2006 15:04:05 GMT")
626-
endDateStr := endDateObj.UTC().Format("Mon, 02 Jan 2006 15:04:05 GMT")
630+
startDateStr := ""
631+
endDateStr := ""
632+
633+
if startDateObj != nil {
634+
startDateStr = startDateObj.UTC().Format("Mon, 02 Jan 2006 15:04:05 GMT")
635+
}
636+
if endDateObj != nil {
637+
endDateStr = endDateObj.UTC().Format("Mon, 02 Jan 2006 15:04:05 GMT")
638+
}
627639

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

driver/web/docs/gen/def.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ openapi: 3.0.3
22
info:
33
title: Rokwire Gateway Building Block API
44
description: Gateway Building Block API Documentation
5-
version: 2.10.0
5+
version: 2.10.1
66
servers:
77
- url: 'https://api.rokwire.illinois.edu/gateway'
88
description: Production server

driver/web/docs/index.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ openapi: 3.0.3
22
info:
33
title: Rokwire Gateway Building Block API
44
description: Gateway Building Block API Documentation
5-
version: 2.10.0
5+
version: 2.10.1
66
servers:
77
- url: 'https://api.rokwire.illinois.edu/gateway'
88
description: Production server

0 commit comments

Comments
 (0)