Skip to content

Commit

Permalink
fix: handle if one length is zero
Browse files Browse the repository at this point in the history
  • Loading branch information
datawhores committed Dec 28, 2024
1 parent c9d2e66 commit 5a6e935
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ofscraper/classes/table/fields/timefield.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,12 @@ def compare(self,value):
)
if min_val==max_val and min_val==arrow.get("0:0:0",["h:m:s"]):
return True
return arrow.get("0:0:0" if value in {"N\A","N/A"} else value,["h:m:s"]).is_between(min_val,max_val,bounds="[]")
elif max_val==arrow.get("0:0:0",["h:m:s"]):
return arrow.get(value,["h:m:s"])>min_val
elif min_val==arrow.get("0:0:0",["h:m:s"]):
return arrow.get(value,["h:m:s"])<max_val
else:
return arrow.get("0:0:0" if value in {"N\A","N/A"} else value,["h:m:s"]).is_between(min_val,max_val,bounds="[]")

@property
def key(self):
Expand Down

0 comments on commit 5a6e935

Please sign in to comment.