apply "Fix incorrect timezone specification for some events (UTC instead of CET)" by octycs from upstream
This commit is contained in:
		
							parent
							
								
									bf5d375274
								
							
						
					
					
						commit
						0257d66050
					
				| 
						 | 
				
			
			@ -128,7 +128,14 @@ def events(scheduleUrl, titlemap={}):
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
if __name__ == "__main__":	
 | 
			
		||||
    events = events(scheduleUrl)
 | 
			
		||||
    events = list(events(scheduleUrl))
 | 
			
		||||
 | 
			
		||||
    # FIX: Some events have an incorrectly specified timezone (UTC instead of CET)
 | 
			
		||||
    for ev in events:
 | 
			
		||||
        if ev['datetime'].endswith("+00:00"):
 | 
			
		||||
            ev['datetime'] = ev['datetime'].replace("+00:00", "+01:00")
 | 
			
		||||
            print(f"Warning: Assuming CET instead of UTC for event '{ev['title']}': {ev['datetime']}")
 | 
			
		||||
 | 
			
		||||
    events = sorted(events, key=lambda x: datetime.datetime.fromisoformat(x["datetime"]))
 | 
			
		||||
 | 
			
		||||
    # Filter already passed events
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue