auto-schedule-pro-v2: fix negative day shifts being interpreted as positive ones
This commit is contained in:
		
							parent
							
								
									edfcc6e1be
								
							
						
					
					
						commit
						d0cd483b73
					
				@ -92,13 +92,16 @@ def process_arguments(args, base_day):
 | 
				
			|||||||
    preferences = {}
 | 
					    preferences = {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    for arg in args:
 | 
					    for arg in args:
 | 
				
			||||||
 | 
					        if arg[0] == "-":
 | 
				
			||||||
 | 
					            if arg[1:].isdigit():
 | 
				
			||||||
 | 
					                selected_day -= int(arg[1:])
 | 
				
			||||||
 | 
					            else:
 | 
				
			||||||
 | 
					                preferences[arg[1:]] = False
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					        elif arg[0] == "+":
 | 
				
			||||||
            if arg[1:].isdigit():
 | 
					            if arg[1:].isdigit():
 | 
				
			||||||
                selected_day += int(arg[1:])
 | 
					                selected_day += int(arg[1:])
 | 
				
			||||||
            continue
 | 
					            else:
 | 
				
			||||||
 | 
					 | 
				
			||||||
        if arg[0] == "-":
 | 
					 | 
				
			||||||
            preferences[arg[1:]] = False
 | 
					 | 
				
			||||||
        elif arg[0] == "+":
 | 
					 | 
				
			||||||
                preferences[arg[1:]] = True
 | 
					                preferences[arg[1:]] = True
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    selected_day = selected_day % 14
 | 
					    selected_day = selected_day % 14
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user