Skip to content

Commit

Permalink
fix timezone bug (#321)
Browse files Browse the repository at this point in the history
  • Loading branch information
VaibhavPage authored and magaldima committed Jul 31, 2019
1 parent 0d7e986 commit 4c0d5ed
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion gateways/core/calendar/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,9 @@ func (ese *CalendarEventSourceExecutor) listenEvents(cal *calSchedule, eventSour
}

lastT := time.Now()
var location *time.Location
if cal.Timezone != "" {
location, err := time.LoadLocation(cal.Timezone)
location, err = time.LoadLocation(cal.Timezone)
if err != nil {
errorCh <- err
return
Expand All @@ -122,6 +123,9 @@ func (ese *CalendarEventSourceExecutor) listenEvents(cal *calSchedule, eventSour
select {
case tx := <-timer:
lastT = tx
if location != nil {
lastT = lastT.In(location)
}
response := &calResponse{
EventTime: tx,
UserPayload: cal.UserPayload,
Expand Down

0 comments on commit 4c0d5ed

Please sign in to comment.