@@ -29,7 +29,7 @@ struct Event: CustomDebugStringConvertible {
2929 var timeString : String {
3030 let dateFormatter = DateFormatter ( )
3131 dateFormatter. dateFormat = " E hh:mm a "
32- dateFormatter. timeZone = TimeZone ( identifier: " UTC " ) // Already in ET, dont convert again
32+ dateFormatter. timeZone = TimeZone ( identifier: " America/New_York " )
3333 return dateFormatter. string ( from: time)
3434 }
3535 var title : String
@@ -152,13 +152,17 @@ class ScheduleParser {
152152 let task = URLSession . shared. dataTask ( with: request) { ( data, response, error) in
153153
154154 guard error == nil else {
155- // @TODO: Error handle
155+ DispatchQueue . main. async {
156+ MessageHandler . showScheduleParsingError ( )
157+ }
156158 print ( error!)
157159 return
158160 }
159161
160162 guard let data = data else {
161- // @TODO: Error handle
163+ DispatchQueue . main. async {
164+ MessageHandler . showScheduleParsingError ( )
165+ }
162166 print ( " no data " )
163167 return
164168 }
@@ -175,7 +179,9 @@ class ScheduleParser {
175179
176180 } catch let error {
177181 // @TODO: Error handle (JSON parse error)
178- print ( " it broke " )
182+ DispatchQueue . main. async {
183+ MessageHandler . showScheduleParsingError ( )
184+ }
179185 print ( error)
180186 }
181187 }
@@ -296,7 +302,7 @@ class ScheduleParser {
296302
297303 // Build the final date
298304 var dateComponents = DateComponents ( )
299- dateComponents. timeZone = TimeZone ( identifier: " America/New_York " ) // Might not be req'd but works
305+ dateComponents. timeZone = TimeZone ( identifier: " America/New_York " )
300306 dateComponents. year = 2020
301307 dateComponents. month = 2
302308 dateComponents. hour = Calendar . current. component ( . hour, from: convertedTime!)
0 commit comments