Skip to content

Commit

Permalink
Fix ts on missing schedules
Browse files Browse the repository at this point in the history
  • Loading branch information
frodrigo committed Feb 28, 2024
1 parent 762eff8 commit f1538b6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions datasources/sources/tourism_system.rb
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,11 @@ def self.date(date)

def self.openning_day(day)
d = @@days[day['day']]
hours = day['schedules'].select{ |s| s['startTime'] }.collect{ |s|
hours = day['schedules']&.select{ |s| s['startTime'] }&.collect{ |s|
hours_start = s['startTime'][0..4]
hours_end = s['endTime'].nil? ? nil : s['endTime'][0..4]
hours_start + (hours_end.nil? ? '+' : "-#{hours_end}")
}.join(',')
}&.join(',')
[d, hours]
end

Expand Down

0 comments on commit f1538b6

Please sign in to comment.